Adding File Path as Comment of image

Started by crocodilu, November 02, 2013, 10:20:58 AM

Previous topic - Next topic

crocodilu

Hi,

Firsty, a huge thank you to Phil for this great tool!
Here is my case. I have a big folder full of images and videos in different folders with different names and I want to move all of them to a %Y/%Y-%m-%d/%Y-%m-%d-%Hh%Mm%S%%-c.%%e like folder and file structure. The thing is, before I do this I want to append in the Comment field of all the images the location they are in (for example I need exiftool to read the path of each file and then right in it's comment section .\folder1\pictures_from_field_trip_x\filename.jpg or whatever folder the file is in)

After this I want to run exiftool -r -d %Y/%Y-%m-%d/%Y-%m-%d-%Hh%Mm%S%%-c.%%e "-filename<datetimeoriginal" .
and after this, another command to also move all the video files in the same above structure based on their Creation-Date .

What I want is not to loose the information I have now about the folder and file-name of my JPG files.
This is what I thought, putting this info in the comment field before mass moving them by the date tree above. Please let me know if you think of a better way to keep information from the folder structure in the event that in the future you want to know more information about a specific picture.

Thanks

Phil Harvey

You can add a comment to JPEG images (so add -ext jpg to the command) by adding "-comment<directory" in the same command that you move/rename the files.  (Then moving the file back to the original directory is as easy as exiftool "-directory<comment" DIR.)

This won't currently work for video files, but stay tuned because I expect to release a new version that will write XMP to MOV and MP4 videos soon.  For XMP you would have to choose another tag, maybe XMP:Description.

- 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 ($).

crocodilu

#2
Thanks a lot Phil, "-comment<directory" is what I needed, but with a little twist. I noticed that when I use the -comment parameter, exiftool doesn't move my files but copies them .
I would like them to be moved so I can see what files were not processed and eventually move them manually after exiftool is finished.

Eventually I can firstly run exiftool -r "-comment<directory" * and then delete the originals manually with del *original or whatever; but maybe there is a more elegant way for them to be moved automatically instead of copied.

EDIT: Found -overwrite_original and -overwrite_original_in_place. Will try them tomorrow and post if I still have issues.
Thx again and looking forward to the new version with video XMP write.

Phil Harvey

Quote from: crocodilu on November 02, 2013, 05:42:23 PM
I noticed that when I use the -comment parameter, exiftool doesn't move my files but copies them .
I would like them to be moved so I can see what files were not processed and eventually move them manually after exiftool is finished.

This is explained in a few different places.  Read the first paragraph of the Notes at the top of the FileName and Directories help page.

QuoteEDIT: Found -overwrite_original and -overwrite_original_in_place. Will try them tomorrow and post if I still have issues.
Thx again and looking forward to the new version with video XMP write.

Right.  Testing on the video write ability hasn't been going well today, so it may have to wait until next release.

- 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 ($).