18 Replies Latest reply on Aug 4, 2011 4:05 AM by r2435

    Base64 Image

    r2435

      Hi, I have an xml document for a dvd catalogue that has an image embedded in base64 format. The text can be tagged and imported into InDesign, however, InDesign doesn't recognize the embedded image and displays a text string. Has anyone come across this and know how to successfully import the image.

       

      The xml code containing the image is as follows:  <img>48/48d838c5-3bf2-4363-9903-9b3f23536610</img>

        • 1. Re: Base64 Image
          John Hawkinson Level 5

          That would be an awfully small image! That is most likely a guid (or even filename!) associated with an externally stored image.

          If you quote more of the XML file (provide context!), including the DOCTYPE and surrounding tags, it might be more clear what is going on.

           

          Note that base64 is an encoding, but not an image format. You could, encode a JPEG in base64, or a TIFF, or a PDF, or PNG, or a PNM, almost anything. So "base64 image" doesn't mean a whole lot.

          • 2. Re: Base64 Image
            r2435 Level 1

            Good point. I'll paste the code below. I'm new to the forum so there may be a way to attach a file - but I can't see it. I've seen the image by pasting the image code into an html file I created to display another base64 coded image using png as the type.

             

            Code as follows...

             

             

            ====================================================================

             

            <?xml version="1.0"?>

            <movies>
            <movie>
            <title>Sherlock Holmes</title>
            <directors>Guy Ritchie;</directors>
            <description>The hangman did his job, Dr. Watson declared the condemned man dead...yet Lord Blackwood has emerged from the tomb to assert his deadly will over 1890 London. Is he in league with the forces of hell itself? Is the whole Empire in peril? It's a mystery macabre---and only Sherlock Holmes can master it. Robert Downey Jr. and Jude Law put memorable imprints on Holmes and Watson in this bold new reimagining that makes the legendary sleuth a daring man of action as well as a peerless man of intellect. Baffling clues, astonishing Holmesian deductions, nimble repartee, catch-your-breath scenes of one slam thing after another---director Guy Ritchie helms the excitement reintroducing the great detective to the world. Meet the new SHERLOCK HOLMES!

            Powered by Gracenote(R)</description>
            <cast>Robert Downey Jr.; Jude Law; Rachel McAdams; Mark Strong; Eddie Marsan; Robert Maillet; Geraldine James; Kelly Reilly; William Houston; Hans Matheson;</cast>
            <rating>PG-13</rating>
            <genre>Action</genre>
            <aspect_ratio>1.85:1</aspect_ratio>
            <languages />
            <release_date>2009</release_date>
            <release_company>Warner Bros. Pictures</release_company>
            <length>2</length>
            <cover_art>/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBw gJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyM jIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCADEAJADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAA AAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0 fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipK TlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAH wEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRM iMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0d XZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6On q8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDxqHTpZgVWQ71kKknuMCrh8OTm23GbPqMGnWV/DG8rs4IaTcPlbp+VbsWs2 0trKglDOgL7cPwo6nkCt0kcspTvocn/AGNPjAf8MHNRf2XMGwHwetdLba/p0LxSebyhDEFGy3IPUCukn+IujyXE0gs 7dPOOSFjPBxj+727eh5pOwKVQ89TRZjj523E46daZ/ZMxk2q7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i0C1+yoPNnxvP 8Q9PpRRUvdG0dgbw/a4X95P2/iHp9KJfD1ptH7ybp6r6n2oopjIJvD9pj783/AH0P8KZF4etN4/eT9P7w/wAKKKnqV 0LS+HrTax8yfOP7w/wpi+HrTyD+8n56/MP8KKKciCE+HrTaf3k//fQ/wqP/AIR60/56T/8AfQ/woorM0LlrolsBGPM mIYspBI5H5Va0/QbQXsGGl/1y9x6j2oorVbGMj//Z</cover_art>
            <location>1</location>
            <img>48/48d838c5-3bf2-4363-9903-9b3f23536610</img>
            </movie>
            </movies>

            ===============================================================

            • 3. Re: Base64 Image
              John Hawkinson Level 5

              Ok, yes. The <cover-art> tag contains a base64-encoded JPEG image of the Sherlock Holmes cover art, yes. Notice it is a little bit longer.

               

              InDesign can't do the base64 decoding for you directly without scripting, though it is not terribly serious scripting.

              How do you envision this working? What is your workflow? Do you have hundreds of these XML files? Are you using Data Merge? Do you want Anchored Images? Are you using XML import?

               

              You could also process the XML with command-line tools to extract/decode the image data. What operating system?

              • 4. Re: Base64 Image
                r2435 Level 1

                Thanks John, you seem to have a really good knowledge of this type of thing.

                 

                This is cut down xml code from an original longer xml file exported from a home Control4 Home Theater System. In the original file their are almost 250 <movie> elements. Other than that the rest of the code is as you've seen above.

                 

                What I'm trying to do is export the xml again in the future when I have more dvd's and simply re-import the xml file to update the DVD catalogue in InDesign.

                • 5. Re: Base64 Image
                  John Hawkinson Level 5

                  Hi, r2435.

                   

                      I'm not quite sure how that answers my questions in post #3.

                  It's really about how you plan to use the file in InDesign. Could

                  you go back and look at them, please?

                  • 6. Re: Base64 Image
                    r2435 Level 1

                     

                    This is the first time I’ve looked into xml with InDesign, so I'm probably coming across pretty clueless but I’ll try and explain what I’m trying to do.

                     

                    It’s a one off project and this would be a single xml file containing 200-300 movie entries (as per the code you’ve seen). I’ll be using XML import into one InDesign file with a selection of Tagged text fields, for example title, director, description, etc, etc. The imagery would be anchored. I’m hoping that using master pages within InDesign the xml content will generate new pages as the xml is all imported. Regarding to operating system, it will be Windows – currently XP Professional.

                    • 7. Re: Base64 Image
                      John Hawkinson Level 5

                      Well.

                       

                      You can do this in straight-up InDesign except for the for the conversion from the base64 image into an actual image. It's tricky and hard to learn ,but you can find instructions on the XML workflows.

                       

                      To handle the base64 elements, though, you will have to use some automation.


                      You can either preprocess the XML files before InDesign imports them, exctacting the image data into seperate files and inserting <img> tags, or you could automate it in InDesign, converting <cover_art> tags into anchored images. I'm a little too busy this afternoon to write you such a script, but perhaps you could post on the scripting forum and perhaps someone can help you out. I don't recall seeing a request for this sort of thing before, but it's not too tough.

                      • 8. Re: Base64 Image
                        r2435 Level 1

                        Thanks for all of your advice John,

                         

                        When you say preprocess the xml, is there a tool that you could suggest? Or is that a custom script again? Prior to our posts I'd scanned the web and this isn't something people seem to mention much. There's plenty of help if I wanted to take it into html though.

                         

                        I though I'd cracked the script option once with the following: http://www.webtoolkit.info/javascript-base64.html

                         

                        But that doesn't seem to do anything.

                         

                        Thanks again.

                         

                        Alan

                        • 9. Re: Base64 Image
                          John Hawkinson Level 5
                          When you say preprocess the xml, is there a tool that you could suggest? Or is that a custom script again? Prior to our posts I'd scanned the web and this isn't something people seem to mention much. There's plenty of help if I wanted to take it into html though.

                           

                          Well, it'd be custom. That is, you could use some sort of preprocessing tool that allows you to customize it for this behavior. It's just not sufficiently common that you can just totally leverage existing stuff.

                           

                          I though I'd cracked the script option once with the following: http://www.webtoolkit.info/javascript-base64.html

                          Well, that's just some Javascript that decodes base64. That doesn't do any sort of XML integration with InDesign.

                           

                          I had bit more time than I expeced to look into this, so I came up with a first cut script for you:

                           

                          #target indesign
                          #include "b64.jsx"
                          
                          var
                              tmpdir = Folder.temp.fsName,
                              ca=app.activeDocument.xmlElements[0].evaluateXPathExpression("//cover_art"),
                              i, f, r, placed;
                          for (i=0; i<ca.length; i++) {
                                   f = new File(tmpdir+"/"+i+".jpg");
                                  f.encoding = "binary";
                                  f.open("w");
                                  f.write(decode64(ca[i].contents));
                                  f.close();
                                  ca[i].contents="";
                                  r=ca[i].insertionPoints[0].rectangles.add(undefined, undefined, undefined, { geometricBounds: [0, 0,  12, 9] });
                                  placed = r.place(f);
                                  placed[0].itemLink.unlink();
                          
                          }
                          

                           

                           

                          This assumes you have downloaded a Javascript base64 implementation and saved it in "b64.jsx". I used http://www.java2s.com/Code/JavaScript/Security/Base64EncodingDecoding.htm.

                          It was the 3rd one I tried. The first 2 didn't like your base64 data, and dropped the first few characters, which were important. Oh, yeah, and I commented out lines 16-20 of it, too:

                           

                          //~       if (base64test.exec(input)) {
                          //~          alert("There were invalid base64 characters in the input text.\n" +
                          //~                "Valid base64 characters are A-Z, a-z, 0-9, �+�, �/�, and �=�\n" +
                          //~                "Expect errors in decoding.");
                          //~       }

                           

                          because the warning appeared for your test data, perhaps unnecessarily. I suspect it's beacuse of the spaces from the way you posted it to the forum, but perhaps not.

                           

                           

                          This script is designed to be run after you have placed your XML into InDesign and autoflowed it.

                           

                          Anyhow, this script gets a tempoary folder, then makes a list of the <cover_art> tags, and declars some variable. It loops over all the cover_art tags, and for each one it creates a temporary file into which it decodes the base64 image data. It then deletes the base64 data from the text stream and replaces it with a rectangle which is an anchored frame into which the image is placed. Then it unlinks the image from the temporary file.

                           

                          This gives you an embedded image workflow. That may be undesirable, but I didn't think it was too obvious where such a script oght to save the files, so I shortcut that by embedding...

                           

                          If you're in over your head, well...that's what XML in InDesign is like, I'm afraid. [Though I'll feel really silly if someone comes along and says there is an easier method...]

                          • 10. Re: Base64 Image
                            r2435 Level 1

                            Hi John,

                             

                            Thanks so much for your last post. This is awesome stuff! I've just worked my way through all the information and given it a try. It's SO close it's painful

                             

                            When I run the script the base64 image code within my InDesign rectangle frame tagged as "cover_art" disappears, and an embedded image is definitely created as I can see it in the links panel. The image thumbnail in the links panel has OV next to it, so I'm sure that the image is in that frame somewhere - it's just not visible. Is there any way that the image could be positioned top left within that rectangular frame?

                             

                            Alan

                            • 11. Re: Base64 Image
                              [Jongware] Most Valuable Participant

                              Can you check if it appears when you make the text frame larger?

                               

                              The image probably is just too large to comfortably fit in the frame. If it appears when you enlarge the frame, you can at least confirm it's in there.

                              • 12. Re: Base64 Image
                                r2435 Level 1

                                I did give that a go initially thinking the image may have been too big. I can however select the frame the image is in and apply:

                                 

                                Object  >  Fitting  >  Fit Frame to Content

                                 

                                and then a 1.5" x 2" image appears. It could be great if the image was able to come into the frame positioned top left as there could be between 200-300 images called into this document.

                                • 13. Re: Base64 Image
                                  John Hawkinson Level 5

                                  OV indicates that the image is in overset text. The script expects that the entire XML is flowed without overset text, as I said:

                                   

                                  This script is designed to be run after you have placed your XML into InDesign and autoflowed it.

                                   

                                  So, if you have a frame with a red [+], click on that, and then with the place gun, shift-click on a page to flow and add new pages. Only after that is done should you run the script.

                                  When I run the script the base64 image code within my InDesign rectangle frame tagged as "cover_art" disappears, and an embedded image is definitely created as I can see it in the links panel. The image thumbnail in the links panel has OV next to it, so I'm sure that the image is in that frame somewhere - it's just not visible. Is there any way that the image could be positioned top left within that rectangular frame?

                                  Oh, you have a frame tagged cover_art? Please upload a screenshot of what you've got so I can see how you have the XML structure tagged. The script was written with the assumption that everything was in a single text frame, and it goes and inserts its own anchored image frames. Possibly not the best way to do it...I am not an expert on these workflows.

                                  • 14. Re: Base64 Image
                                    r2435 Level 1

                                    Initially I just wanted to see how the xml imported, then work on look and feel afterwards, so I'm working with the simplest of InDesign files currently.

                                     

                                    With 3 screens I've tried to show a basic step-through:

                                     

                                    - Tagged text and separate 'cover_art' frame

                                    - xml imported

                                    - After running script

                                     

                                    01-layout.gif

                                    02-import.gif

                                    03-script.gif

                                    • 15. Re: Base64 Image
                                      r2435 Level 1

                                      I meant to mention that I did set up an InDesign file that flowed the imported xml adding pages without any overflow. When I ran the script an alert flagged this...

                                       

                                       

                                      ===========================================================

                                       

                                      JavaScript Error!

                                       

                                      Error Number: 11265
                                      Error String: This value would cause one or more objects to leave the pasteboard.

                                       

                                      Engine: main
                                      File: convertBase64.jsx
                                      Line: 16
                                      Source: placed = r.place(f);

                                       

                                      ===========================================================

                                      • 16. Re: Base64 Image
                                        John Hawkinson Level 5

                                        Sorry for the delay. Maybe it would help to see how you have the XML structure set up. I don't quite see how you could have gotten what you have layed out by dragging items out of the Structure pane, and if you just tagged the rectangle with the Tags panel, I don't see how it would work with autoflow or get you to an anchored frame.

                                         

                                        I'm certainly not an expert on InDesign XML (though it's possible I'm the closest you'll get), but I don't think that workflow is going to work.

                                         

                                        you said you tried it my way and got errors. It works for me. I took your XML file and copied the <movie> tag a bunch of times.

                                        Then, from a raw InDesign layout, Imported your XML, and dragged the <movies> (not <movie>) into the layout. I clicked on the overset text indicator and shift-clicked on the layout and all remaining pages flowed. Then I ran the script.

                                        • 17. Re: Base64 Image
                                          r2435 Level 1

                                          Hi John, thanks for the post, and sorry for the long delay. I've had to go away for a bit but will be trying out your suggestion for structure asap as soon as I can. I've been thinking about my structure and realized that I've built it on the <movie> element rather than <movies> so it wouldn't flow.

                                          • 18. Re: Base64 Image
                                            r2435 Level 1

                                            Hi John, I'm finally back onto this again  :-)

                                             

                                            What I've done is gone back through everything to get a feel for it all again, and try to replicate the same file as worked for you. So I've gone back to the xml file, replicated <movie> a couple of times, then opened a new InDesign file, imported the xml, and then dragged <movies> from the xml structure onto the InDesign file. Then clicked the overflow, and shift-clicked to auto-flow the document.

                                             

                                            The attached screen shot shows the xml structure, the auto-flowed pages, and part of the actual page with the first movie codepart-showing.

                                             

                                            What I'm finding, is when I run the script it errors with the message in the previous post above.

                                             

                                            STRUCTURE.gif