2000+ Photos Import = Metadata

Started by owner, July 26, 2011, 01:06:57 AM

Previous topic - Next topic

Phil Harvey

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

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

owner


Phil Harvey

#32
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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

owner

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?

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

owner

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.



Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

owner

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.


Piergi


MacGrunt

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.