Hello,
I have 2000+ photos. I want to be able to import a .csv file with photo captions directly to individual photos.
can your program do this for me? How exaclty?
Can this program / a plug in be used with Adobe Lightroom 3?
Or do I need to install the program on my server, as I note it has been written in PEARL. How do I use this program?
Any help appreciated. Please PM or Email me.
You can import CSV files if they have the proper format. For example, "test.csv":
SourceFile,ImageDescription
a.jpg,Some caption
b.jpg,Some other caption
with this command
exiftool -csv=test.csv .
will set the ImageDescriptions for a.jpg and b.jpg in the current directory.
You don't need to install Perl. Use the Mac or Windows version depending on your system. On a Mac, run the command inside a Terminal window. On a PC, run it inside a cmd.exe window.
There are ExifTool plug-ins for Lightroom, but I don't know of any that will read CSV files.
I'm not PM-ing the response so that other people may learn from this too.
- Phil
HI, Many thanks for the reply.
I have installed the WIN version and all went well.
I'm still not sure how to import a .csv file which contains 2000+ photo captions, which would be written directly to my images?
How exactly do I set this up?
I have a folder on my desktop (PC) which contains the images. Next need to get captions to those images.
Any help greatly appreciated.
For simplicity, it is easiest to work in a top-level directory on your hard disk, say "c:\images".
Here is a step-by-step:
- Install exiftool for command line use (see the install instructions (https://exiftool.org/install.html#Windows)).
- Run the Windows "cmd.exe" utility.
- In the cmd window, type "cd \images" then press RETURN to change to the directory containing the images. This directory should also contain your .csv file (let's call it "test.csv").
- In the cmd window, type "exiftool -csv=test.csv ." and press RETURN to import the .csv data into the images.
Note that the .csv file must be in the format mentioned in my previous post, with the first row giving the tag names to write and the first tag name must be SourceFile.
- Phil
Many thanks Phil for the reply. I'm really pleased you can patiently work with me to get this sorted out.
I am having trouble. Would it be possible to do a live-chat with you, so we can 'walk through this together'? Just an idea.
OK. I have followed along exactly to your instructions.
NOTHING is being written to the images.
In my file (.csv) file I have named it "photocaptions.csv". I have put both the .csv file and .jpg images in a folder "Photos" on my C:\ drive . As well as the exiftool = c:\photos
All my images (.jpg) are in folders, containing 20 or so photos. 1 folder (i.e. abc with 20 .jpg images or so). BUT the captions are in one long list, .csv file.
Ideally I want 1 caption to be written to it's specific image.
What do I need to do, to get my .csv file with captions written to my images - if the images are in folders? Or do I need to cut&paste all images into 1 folder, for the .csv file to be written correctly?
My fields in my .csv are this: SourceFile (containing the image file (IMG_001.jpg) ImageDescription (containing the photo caption) = but these are in columns. How do I separate these with a comma ?
More clarification is needed and I sure hope this works, otherwise I have to 'cut & paste' each caption and put it in separatly individually with my photos.
Please help ASAP. Thank you so much.
Unfortunately the live chat won't work.
If the images are in sub-directories, then the "SourceFile" column of the .csv file should also contain the directory names.
If you attach the .csv file and cut-and-paste the exiftool output from the cmd window we should be able to solve this quickly. (except that I am leaving work for the day, so I won't be able to check back again here until I get home in a few hours)
- Phil
Thank you Phil.
It seems like I am doing something wrong, because still the captions are NOT been written. I presumme once the captions are written, I can open the photo in a photo editing program, look at properties to see the caption / comment?
In my .csv file I have this:
SourceFile ImageDescription
alberta/00450004.JPG Bow River looking towards downtown Calgary
alberta/00450014.JPG Heritage Park and the Glenbow Resevoir, Calgary
The folder "alberta" contains the pictures = both photocaptions.csv and folders are in c:\photos
So I open cmd, change dir and go to c:\photos
next I use your command: exittool
Nothing seems to happen. All i see in the cmd window, is description of what the exittool program does. Nothing says the captions have written. I check the image, and no caption.
What I am doing incorrectly? How do I get the captions written?
Hi,
Well, I've tried too (just being curious) and didn't success. My scenario:
Five jpg files in:
d:\aa\xx\img1.jpg
d:\aa\xx\img2.jpg
d:\aa\xx\img3.jpg
d:\aa\xx\img4.jpg
d:\aa\xx\img5.jpg
I've created (text file renamed to) csv in:
d:\aa\test.csv
csv file contains:
SourceFile,ImageDescription
d:\aa\xx\img2.jpg,Second
d:\aa\xx\img4.jpg,Fourth
Now, being in d:\aa, I executed:
d:\aa>exiftool -csv=test.csv .
and got:
1 directories scanned
0 image files read
As for path for images (in csv), I've tried slash, backslash, relative path.. we better wait for Phil :)
Bogdan
owner: Your .csv file isn't formatted properly. You need commas between the fields, not spaces or tabs. There may be other problems, but that is the most obvious. Paste the exiftool output if it doesn't work after fixing the csv file.
bogdan: You have 2 or 3 problems:
1) You didn't specify -r, so exiftool looked only in the d:\aa directory.
2) you must be consistent with the directory specification. The directories inside the .csv file must match those on the command line. So you should specify "d:\aa\xx" on the command line instead of ".". (or d:\aa with -r)
(Edit: this is no longer a problem when using exiftool 8.64 or later.)
3) I'm not sure about the backslashes. ExifTool may change these to forward slashes, but you will see this in the error messages if it is a problem.
- Phil
I see.. I misunderstood csv usage -I though paths in csv is all what's needed. Now, by using
exiftool -csv=test.csv -r d:\aa
it works as expected.
To complete this csv usage thread.. how to avoid (hide) messages
No SourceFile 'd:\aa\....' in imported CSV database
for each existing file not specified inside csv file?
Bogdan
Bogdan: The only way to avoid these warnings is to use -q -q, but that will disable other messages too.
owner: I should have mentioned that a good technique to determine the correct .csv formatting, including the necessary directory names, is to extract the information with the -csv option first, like this:
exiftool -csv -f -imagedescription DIR > out.csv
Where DIR is the name of the directory containing the images. Add a -r option if some images are in subdirectories of DIR.
This command will create "out.csv" in the proper format. Just insert the descriptions you want in the "ImageDescription" column when writing with this command:
exiftool -csv=out.csv DIR
The only remaining problem is what information do you want to write? I have chosen ImageDescription, which is the common EXIF tag, but for maximum compatibility you may want to write MWG:Description instead.
- Phil
Thank you so much for all the help; much appreciated.
OK. I have done what you say Phil, and have created a out.csv file; which worked well - but I don't have any image descriptions included.
Source file provided me with the correct 'path' to the images - but it did not write image descriptions.
Below is what your command did:
exiftool -csv -f -r -imagedescription DIR > out.csv
SourceFile ImageDescription
c:/photos/alberta/00450004.JPG -
Is there a way to add image descriptions to the .csv file also?
Next, once the .csv file is in the 'right format', I can use this command to write captions to the images, right?
exiftool -csv -r=out.csv
Then presummably each caption (image description) will be writtein automatically the the .jpg image, and then I can open the image, view properties to see the description.
I want to write the image description to the captions.
You can either edit the .csv file by hand using a text editor or output a .csv file in this format from your database software.
However, you have the -r option in the wrong place. It should be:
exiftool -csv=out.csv -r DIR
But try a single file to find out what tag your software displays for the caption. See if this works:
exiftool -imagedescription=hello test.jpg
If not, change the caption with your software and use exiftool to see where it went, then write this tag instead (this is FAQ 3).
- Phil
Hi,
Thanks for that. I tried that exactly how you said, however it came back saying "No Source File".
Perhaps the easiest thing to do now, is to open Adobe Lightroom and "cut & paste" individual descriptions/captions per photo.
Just can't get your program to work :(.
If I remember correctly, Lightroom is capable to store that info directly in jpg files (if you choose to). Is there a reason why you're not using that option?
Bogdan
Hello,
Yes, thank you very much for all the replies.
I have now found a way to do this - through Adobe Lightroom3
I can add my image description/caption and after "saving meta details" it will automatically be written to the image. Awesome ;)
Thanks again for your help.
Quote from: owner on July 29, 2011, 02:09:56 PM
I tried that exactly how you said, however it came back saying "No Source File".
This problem is simple to solve. Take note of the SourceFile mentioned in the error message, and be sure this exists in the first column of the .csv file
exactly as printed in the message.
- Phil
Hi Phil,
Thanks for the reply. I am having trouble using your program.
But I would like to use it ~ if it can write all my captions from a .csv file to each image and save the image description.
I can do this via LR, but it is taking forever!
I have about 10 folders with different photos - and somehow can't get the image description written to the specific image. Not sure what I am doing incorrectly, but it just won't write.
I have the 'sourcefile' / image file saved to out.csv, but now the image description for that sourcefile isn't been written.
All the fields are correct, where it comes back with "No Source File" - I have checked and everything is 'in' the .csv file fine.
The difficulty now appears to - how do I write the image description to each image automatically?
Any other help greatly appreciated. I would love to continue with your program; if it will do this.
Solving the "No Source File" problem is one thing (and should be easy -- you must be just missing some little detail, but I can't help with the details if you won't post the exact .csv file and exiftool output).
But automatically writing the image description is another. Where do you plan to get this information from? To work automatically, the information must already be stored in an electronic form somewhere. If in a database or spreadsheet, then you just have to work out how to export the proper format .csv file for exiftool. If the information is contained in the file name or some other metadata in the file, then you can use exiftool to move this information to the necessary location. But if neither of these is the case, I don't see any way to automatically tag the images anyway, so we would be wasting our time to get this working.
- Phil
Hello
I am willimg to work with this program, if you can ensure the image descriptions from thr .csv file will be automatically applied to the images.
Yes, sorry I missed that...i can send you csv and any error messages.
Obviously I am not doing it correctly.
Once I have the csv file ready with both source file and discription, what code do I use to copy image description to the images.
Please continue to help. I can send u file in few hours, and lets see if we can get this done today.
Sorry for the delay. I am on vacation now so I won't be sitting at a computer all day like I usually do.
Your .csv file is the wrong format. The first line must be (exactly):
SourceFile,ImageDescription
There must be a comma between the tag names, no spaces, and a newline at the end.
As I said, use the "exiftool -csv -imagedescription -f -r DIR" command to see the exact format, where DIR is the name of a directory containing the images.
But I am just starting to repeating myself. Try reading what I have posted so far and following my advice exactly. You should be able to get this working.
- Phil
Hi Phil,
Thank you so much for your continued help; I really hope we can get this work. Please try and respond asap.
I have ensured the .csv file is 'set up' correctly with "SourceFile,ImageDescription" (no spaces or tabs).
Next, I use your command to "write image descriptions to the images" = but NOTHING is written. I view image properties to see NO captions.
This is the command I used: exiftool -csv -ImageDescription -f -r c:\Photos
I next get multiple WARNING messages:
Warning [minor] Adjusted makernotes base 4220 c:\photos\gallery\alberta\0001.jpg
49 directories scanned
1948 image files read
Then it shows me multiple lines like this c:\photos\gallery\scotland\004.jpg
How do I fix this warning, and will the image description be written to the images?
I have a total of 1948 images, but only 876 captions.
Can your program, write the 876 captions to the images; and just ignore the other images in the folders?
Please help - what do I do now?
Regards.
The command you gave is for generating the .csv file. To modify images from data in the .csv file, use this command:
exiftool -csv=out.csv -r DIR
This command assumes that your .csv file is named "out.csv" and exists in the current directory when you run exiftool. To determine your current directory name, type "pwd" then press RETURN at the command prompt.
- Phil
Thank you Phil.
I do appreciate your help with this.
I tried your command; only to receive Errors - and such no captions were written to any image.
The error says "No source file c:\photos\gallery\scotland\Img_0591.jpg" per .csv file
BUT I checked both the .csv file to see the source file & image there - and then checked the image in that folder; to find the image there. So not sure why the program came back with error.
I think what I will do now, is a) find another way to do this OR b) use adobe Lightroom 3 and "cut & paste" every caption in, then save it to images that way.
Unless, of course you have any other suggestions? Do you know of any other program that would do this for me? (take a .csv file with photo captions and write them to images?)
Thanks again.
Quote from: owner on July 31, 2011, 11:38:47 PM
The error says "No source file c:\photos\gallery\scotland\Img_0591.jpg" per .csv file
If that is the exact message printed by exiftool, then it will work if there is a line exactly like this in the .csv file:
c:\photos\gallery\scotland\Img_0591.jpg,some captionThere must be no extra spaces, and the .csv file must be plain text. Use the command "
type out.csv" at the command line to list the contents of the .csv file to be sure it is the correct format.
- Phil
Hi Phil,
Thank you for your help. I have tried everything you said, more than once - and I still can't get this program to write my captions to the images.
I think now I am ready to give up on it, and will revert to 'cut & paste' through adobe lightroom3.
I wonder if you would be willing to "do this for me" ?
I can send you my csv file so you can esure it is in the right format, and images if you need them.
If not, then not to worry and I will work with Lightroom from now on. Also, would you know of any other programs that may do this?
Send me your .csv file and the "out.csv" file from this command:
exiftool -f -r -csv -imagedescription DIR > out.csv
(with DIR replaced by your directory), and I'll sort this out.
- Phil
Hi Phil,
Thanks so much. I will PM you, but not sure how to attach a file? Can you give me your email address? Please PM it to me.
My mail is philharvey66 at gmail.com
Thanks very much Phil ~ I have emailed you.
I got one "out.csv" in the mail you sent, but I asked for two.
Please also send me the "out.csv" generated by the following command:
exiftool -f -r -csv -imagedescription DIR > out.csv
where DIR is the name of the directory containing your images.
- Phil
Hi ~ I will email you.
OK, the .csv file you are trying to use to write the descriptions looks like this:
"SourceFile,ImageDescription",
"0001.JPG,some description",
(the quotes are part of the file, but they shouldn't be)
but the output from the exiftool -csv command looks like this:
SourceFile,imagedescription,
c:/Photos/gallery/alberta/0001.JPG,some description,
Your input .csv file must look like this too. You must remove the quotes around each line of your input .csv file and add the directory to all file names (ie. c:/Photos/gallery/alberta/). If you do this properly, then you will be able to use this file to write the ImageDescriptions to each file.
Actually, there is still a problem. I don't know why there is an extra comma at the end of each line in the output .csv file. There shouldn't be, and it isn't there when I run the command here. So as well as these changes, remove the trailing comma so the input .csv file looks like this:
(Edit: this is no longer a problem when using ExifTool 8.62 or later)
SourceFile,ImageDescription
c:/Photos/gallery/alberta/0001.JPG,some description
Here I have also capitalized ImageDescription, but that shouldn't make a difference.
- Phil
Thanks very much Phil.
I have tried again. I extracted the correct source file (with the folder names c:\photos\gallery\alberta\IMG_001.jpg).
Is there any way I can extract the image description WITH the source file from your program as well?
Because, when I use the image description from my saved .csv file and put it against the source file - in order, it actually isn't in order.
The generated source files do not work with the image descriptions.
An example is: source file = c:\photos\alberta\IMG_001.jpg with the image description = Sienna, Italy
(as you can see Sienna, Italy does not go with photos in ALBERTA, Canada)
This is where things get a little confused. If I take my original .csv file that I saved with image descriptions - and use it with the file (.csv) that was extracted from your program to generate the source field/folder = it generates a list of source fields. If I "cut & paste" the source field and put it towards my original image description file - it doesn't work in order.
I do hope this makes sense.
Can your program extract from c:\photos\gallery, the correct source field and somehow extract or put in the correct image descriptions with the correct source field?
If not, then the source field works fine - but it is not easy to see what image description goes with the source field.
I have 2 files = The original .csv file with my saved image descriptions - and your out.csv file containing the correct source field.
Putting the two .csv lines together (cut from say line 1 from out.csv = to line 1 from original csv containing the image descriptions DO NOT work. The order is all messed up.
Any ideas?
Quote from: owner on August 03, 2011, 09:19:04 PM
Is there any way I can extract the image description WITH the source file from your program as well?
If the descriptions are already in the files, then I don't understand why you want to write them. Also, if so then apparently they aren't stored in ImageDescription. Use
exiftool -s FILE to see the tag names for all metadata in a file, and substitute the appropriate tag name for ImageDescription when extracting. As I mentioned earlier, you might want to write MWG:Description for best compatibility. It will write EXIF:ImageDescription, IPTC:Caption-Abstract and EXIF:Description.
Quote
This is where things get a little confused. If I take my original .csv file that I saved with image descriptions - and use it with the file (.csv) that was extracted from your program to generate the source field/folder = it generates a list of source fields. If I "cut & paste" the source field and put it towards my original image description file - it doesn't work in order.
Yes, this makes sense, but exiftool can't do this for you either.
Are the file names unique, or do duplicate file names exist in different directories?
If they are unique, you could do this:
1) run "
exiftool -csv -filename -imagedescription > out.csv"
2) import "out.csv" from above into a spreadsheet program (ie. Excel)
3) sort the rows according to the Filename (the 2nd column)
4) import your other file into the spreadsheet and sort by filename too
5) you should now be able to match up the filenames from one file with the other
6) remove the filename columns and export the SourceFile and ImageDescription columns to a CSV file with the proper associations
7) use this CSV file as input to exiftool
- Phil
Hi Phil,
Thank you so much for your reply. Much appreciated ~ however I am now lost.
I have 900 captions or image descriptions which somehow need to be written to it's own .jpg image so it goes into the meta / iptc / properties of a .jpg image.
Can exiftool do this? I think I am missing something.
It would take far to long to cut + paste each caption to it's relative .jpg image (file number) as appears in the .csv file = so I was really hoping there was an easier method.
Perhaps Adobe Lightroom 3 would be the best way.
I wonder if you would be able to do "remote assistance" with me so you can see my computer from your end. I use Team Viewer and it works well> This way you can "see" what I am doing; and if I am missing any steps or if exif tool would do what I want it to do, by means of writting captions to photos.
I was really hoping I could somehow generate (or have my original) .csv file and it would write to the images - no matter what order the images / file names per image description / caption they are in.
I do appreciate all your help with this, and please let me know if remote assistance is an option of us to sort this out.
Best regards.
I took a close look at the .csv files you sent me. I don't know how you intend to match the descriptions with the files because there are a number of files with the same name and different descriptions. There just isn't enough information for me to automatically determine which description goes with each file.
Unless you can automatically generate the necessary information, the only alternative is to do this by hand. If this is the case then you might as well use Lightroom because it means that you can't take advantage of the batch processing abilities of exiftool.
- Phil
Thank you Phil.
Thank you for helping me this far - however, I have decided to revert to Lightroom in order to add my captions to images.
I will leave it like this for now, and hope to use your program in the future.
Thanks again for all your help.
Phil, you are a saint. ;-)
Piergi
Oh, wow, Phil – you have GOT to be the most patient man on the planet.
Thanks for leaving this up – you were right – it is helpful for other newbies (eg. me) to learn from.
I am so grateful for ExifTool. Good on you.
m.