20 Replies Latest reply on Sep 28, 2015 9:25 AM by squidz

    Inserting an image from a CSV file

    Jim04 Level 1

      I am trying to create a document that is a directory of members of a community.  The directory is in a CSV file.  One ot the fields is a @photos field that contains the path to the location of the images on my local compiuter,  When I try and preview with the Data Merge panel I get the attached error message,  The path reads:

      /Users/jhaynes/Documents/Falcons_Landing/images

      All the other fields preview correctly.

      Screen Shot 2013-08-18 at 2.56.26 PM.png

        • 1. Re: Inserting an image from a CSV file
          Peter Spier Most Valuable Participant (Moderator)

          The path needs to include the file name for each individual file as well.

           

          The error sounds like either you didn't include the full file name, or the file isn't there.

          • 2. Re: Inserting an image from a CSV file
            Jim04 Level 1

            I added the full file name so the path reads:

            /Users/jhaynes/Documents/Falcons Landing/images/jhaynes.jpg

             

            or

            /Users/jhaynes/Documents/Falcons_Landing/images/jhaynes.jpg

            (no space between Falcons and Landing)

             

            And get the same error code in all cases.

            • 3. Re: Inserting an image from a CSV file
              Peter Spier Most Valuable Participant (Moderator)

              I just realized you haven't specified a drive. The only time you don't need the full path is if the images are inthe same folder with the .indd file.

              • 4. Re: Inserting an image from a CSV file
                Jim04 Level 1

                I changed the path to:

                Macintosh_HD/Users/jhaynes/Documents/Falcons_Landing/images/jhaynes.jpg

                Sill same error message

                • 5. Re: Inserting an image from a CSV file
                  MW Design Level 4

                  In a new document, place one of the images. Look at the links panel, copy the path. Use that path in the merge file.

                   

                  Mike

                  • 6. Re: Inserting an image from a CSV file
                    Steve Werner Adobe Community Professional & MVP

                    I recall the easiest thing to solve the problem was to put the images in the same folder as the INDD file.

                    • 7. Re: Inserting an image from a CSV file
                      MW Design Level 4

                      @Steve,

                       

                      It is, on the one hand. On the other hand--organizing and not having duplicate images on network volumes or even one's own computer--it isn't a great solution.

                       

                      Relative paths would be great, too (like with XML merges). If I were to copy/move final images to another destination, I would prefer an "images" folder below the publication.

                       

                      Mike

                      • 8. Re: Inserting an image from a CSV file
                        flaming1 Level 2

                        I may be wrong - it has been a while since I last did this - but I think you need to replace the slash '/' with a colon ':' in your path for Excel/csv files.

                         

                        EDIT: I just tested this and changing the slashes to colons does indeed fix the problem.

                        • 9. Re: Inserting an image from a CSV file
                          Willi Adelberger Most Valuable Participant

                          Build up the entry in the csv field like "@imagename". Easiest way is to put the images in the same folder but it works also if they are somewhere else. So I would look into the link panel and try first with a sample file how it works best to write the path on your OS. Then you will be able to build up an export mode from your database.

                          • 10. Re: Inserting an image from a CSV file
                            Jim04 Level 1

                            Moving the image to the same folder as the INDD fiie did solve the problem.

                            Many thanks

                            • 11. Re: Inserting an image from a CSV file
                              Laubender Adobe Community Professional & MVP

                              @Jim – the right syntax for your Mac OSX would be:

                               

                              Macintosh_HD:Users:jhaynes:Documents:Falcons_Landing:images:jhaynes.jpg
                              

                               

                              : instead of /

                               

                              Note: it's all case sensitive.


                              In my personal case the line above would not work, because in my system it's "Macintosh HD" (a blank between Macintosh and HD) instead of "Macintosh_HD" with an underscore. But this may vary…

                               

                              It's amazing, that InDesign's datamerge functionality on Mac OSX relies on that old syntax, wheras you could go to your images folder in the finder with typing "Users/jhaynes/Documents/Falcons_Landing/images" in the Go To Folder dialog. Using the : syntax there would not work.

                               

                              That leaves one question:

                              What to do with special characters in file names like umlauts äAöÖüÜ, accented ones like áàÁÀ etc.pp.?
                              Will they break that workflow on Mac OSX with HFS+ formatted volumes?

                               

                              Very likely…
                              And that's because on Mac OSX umlauts and accented characters in file names are composite characters (made out of two glyphs) instead of single characters. But not only because of that…

                               

                              Here an example:

                              You found out that the easiest way to get a file path is to drag a file to a pure text file opened in TextEdit App.

                              Fine. You now know, that all "/"-signs must be changed to ":". No problem with a quick find/change action.

                              Then you saved the file as pure text file with a txt suffix.

                               

                              All good and well?
                              Perhaps. Perhaps not.

                               

                              A simple "ö" in a file name could ruin your workflow!

                               

                              Datamerge in InDesign would accept the text file as source, but would have problems to place the file with the umlaut. Precisely it will see the "ö" not as "ö" but as: "Äà"!

                              Ah! You think, the composite characters problem kicks in. And right you are.

                               

                              No problem then: we could replace "ö" with our own typed "ö" in TextEdit.

                              But to our surprise datamerge get the following instead of an ö: "√∂". Another composite…

                               

                              If you open the text file in TextEdit you cannot spot the difference.

                              You can only see there is the represantation of character "ö".

                               

                              Here the solution to this puzzle:

                               

                              Choose "Unicode (UTF-16)" instead of "Unicode (UTF-8)" when saving your text file to pure text in TextEdit.

                               

                              Uwe

                              • 12. Re: Inserting an image from a CSV file
                                Jim04 Level 1

                                Uwe,

                                I agree the it would be very strange not to be able to use the / to separate directores.  I am running OS 10.8.4 on my Mac, the most current version of OSX.  If I Cmd+I on the image the path is noted as /Users/jhaynes/Documents/Falcons Landing/Directory.  I added the _ between Falcons Landing as I thought this might be the reason Indesign counld not find the image.  As it turns out adding the underscore _ did not resolve the problem.  Moving the .jpg image file to the same folder that contains the indd file did solve the problem and Data merge did find the image.

                                 

                                I would lke to have all my images for this indd file in a separate folder, but until I can resolve this issue, this work-arround solves my immeidate proble.

                                • 13. Re: Inserting an image from a CSV file
                                  Laubender Adobe Community Professional & MVP

                                  If I Cmd+I on the image the path is noted as /Users/jhaynes/Documents/Falcons Landing/

                                   

                                  @Jim – do not exchange blanks in the path/file names with underscores. That will ruin the workflow.

                                   

                                  The easiest method to get the file path + the file name is to drag the file from the Finder to an open TextEdit file. Provided(!) the TextEdit file is set to pure text.

                                   

                                  cmd + shift + t is the toggle command for this.

                                   

                                  What is missing then, also with cmd + i, is the name of the volume at the start of the path.
                                  Usually this happens to be "Macintosh HD". Add : to it to separate it to added sub-folder(s).

                                   

                                  Then change all the remaining "/" characters between the folder names to ":" , save the text file with UTF-16 encoding and you are ready to go. InDesign's datamerge feature needs all that for file path discription. Nothing more, nothing less…

                                   

                                  If I get you right, the right syntax for your example file would be:

                                   

                                  Macintosh HD:Users:jhaynes:Documents:Falcons Landing:images:jhaynes.jpg
                                  

                                   

                                  See, no underscores for blanks ;-)

                                   

                                  Uwe

                                  • 14. Re: Inserting an image from a CSV file
                                    Jim04 Level 1

                                    Uwe,

                                    You are absolutely correct this path works perfectly.  I pated the path into TextEdit and saved to Unicode (UTF-16

                                    Many thanks

                                    • 15. Re: Inserting an image from a CSV file
                                      JennH33 Level 1

                                      This took me ages to rectify - thanks for this post guys! Very helpful, repeated the advise of copying images to the same location as the indd file and it ran perfectly.

                                      • 16. Re: Inserting an image from a CSV file
                                        squidz

                                        I am still struggling with this. Last year I did this same publication and simply set the image in the same directory with the InDesign file and simply used the file name without all of the extraneous path info, like "/peg.eps." I did not have to use the full path. I did not have to use colons. I can go back and look at the CSV files that were used.

                                         

                                        This time, the image will simply not make itself visible.

                                         

                                        I have set up a test document and a test Excel file that only includes an image. I've tried "/test.tiff,":test.tiff," I've tried the full path using the Text Edit method mentioned above. The image will never display in the

                                         

                                        I don't understand what the issue is. It simply wasn't this difficult last time.

                                        • 17. Re: Inserting an image from a CSV file
                                          Peter Spier Most Valuable Participant (Moderator)

                                          If the image is in the same folder as the data file, don't put anything before the filename, just the name itself like image.tiff.

                                          • 18. Re: Inserting an image from a CSV file
                                            SJRiegel Adobe Community Professional & MVP

                                            In my experience, if you want to use just the file name, you have to put the CSV file in the same folder with the images. It doesn't matter where the InDesign file is.

                                            • 19. Re: Inserting an image from a CSV file
                                              squidz Level 1

                                              I've tried both of those options.

                                               

                                              I created test document: imagetest.indd

                                               

                                              I dropped one big box into it with the Rectangle Tool that is 5 x 5 inches.

                                               

                                              I created an image: test.tiff that is 2 x 2.

                                               

                                              Set a column in Excel '@image and in it I have tried:

                                              test.tiff

                                              /test.tiff

                                              :test.tiff

                                              SID iMac HD:Users:SID_iMac:CLIENTS_SIDiMac:C@R-TexasSchoolGuide:NorthTexas-2015:TSG-Dallas-source: test.tif

                                               

                                              I have put the resulting CSV in both it's original location and I have put it in the same directory as the .indd file and the test.tiff.

                                               

                                              Same result every time: no image displays.

                                               

                                              Sudden question: Could the "@" in the directory in my path be an issue?

                                              • 20. Re: Inserting an image from a CSV file
                                                squidz Level 1

                                                Man...I remove the freaking "@" in my directory name and NOW I can see the dang image. Ugh. Stupid mistake. I think now, i'm free to get back to the simplicity of the previous year's production of this thing. It took typing it out and seeing it in front of me in the forum to snap.