Copy filename of the image into the caption (on a mac for picasa)

Started by dnrugs, July 12, 2010, 10:11:03 AM

Previous topic - Next topic

dnrugs

Any help with doing this on a Mac? I'm totally green when it comes to the Terminal.

What I've done is download the .dmg and installed exiftool on my computer (wherever its chosen to install it I can't say). I then follow the instructions and go to the Terminal and type "exiftool"...

I've got a folder on my desktop that is full of images I want to apply the script to to use the filenames as captions in Picasa.

now what...?


Thanks in advance for your help!

Phil Harvey

The trick is to first determine where picasa expects the caption.  Maybe IPTC:Caption-abstract is a reasonable guess.  In this case, type the following in Terminal, then press RETURN:

exiftool "-IPTC:Caption-abstract<filename" ~/Desktop/FOLDER

where FOLDER is the name of the folder on your desktop (quoted it if it contains spaces).  The tilde (~) is a short-form for your home directory name.  This command will back up all original images with "_original" added to the name, and copy the filename to the IPTC:Caption-abstract tag of the updated image.

If Picasa doesn't recognize these new captions, try writing a caption in Picasa then use exiftool to see where it went:

exiftool -a -G1 -s FILE

where FILE is the name of the image with the Picasa caption. Then use exiftool to copy the filename to this tag instead.

Good luck.

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


CBrutvan

I want to thank you for this thread and the solution. I am a Mac user but had to figure out where the Terminal was - and then I got this to work. I'm uploading travel slides my grandparents took around the world on Picasa for other family members to see and I absolutely needed to find a way to transfer the file name as the caption in Picasa so they can get the details of what they are looking at. THANK YOU!!!

Phil Harvey

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

laura1814

Thank you so much for this explanation.  It is similar to what I want to do, though I am using Windows 7.  (I have used ExifToolGUI in the past but never tried command line operations.  I was a power user 20 years ago and had some experience with unix but for practical purposes I am a newbie and I work best from concrete examples.)

What I wanted to do was copy the filenames to a Windows-based tag (the ones that can be seen and modified from Windows Explorer).  I am reasonably sure that the tag name is Xmp:Subject, and have successfully run the command line to add the tag.  But I would like to make two further refinements:

1.  copy the filename to the tag without the extension (.jpg)  (i.e., the new tag reads "filename01" instead of "filename01.jpg). 

2.  add/append the tag to the file's existing tags, rather than overwriting the existing tags with the new tag.

Are either of these possible?  If so, can you show me the modified command line?

Thank you for your time and effort. 




Phil Harvey

This recent post explains exactly this.

Just use "subject" instead of "title", and "+<" instead of "<" to add to existing keywords.

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

laura1814

Thank you.  I had seen that other post you linked to but did not really understand it.  So let me make sure I've got this right.

After installing the sample config file (which I do by placing a copy of the contents of http://www.exiftool.org//config.html in the same directory as the exiftool executable file, in a text file named .ExifTool_config), I then maneuver to the appropriate directory and enter the command

exiftool "-subject+<basename"

If not already in the folder, I would need to add the folder path, in double-quotation marks (since I am using Windows and the path includes spaces).

I will try this.  Thank you so much for your time. 

Phil Harvey

Yes.  Except that you need to add "." to represent the current folder name if you are already in the folder you want to process:

exiftool "-subject+<basename" .

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

laura1814

Oh, thank you, thank you, thank you!  And for your super-fast response with the correction.  I would never have figured that one out.  I would have tried *.*

Anyway, it worked perfectly, and I think I even understand it well enough to try a few other simple operations.  Thanks for being so accessible!

Phil Harvey

Glad I happened to be by the computer when you needed help.

There are a few reasons why "." is preferable to "*.*".  Read about them here.

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

laura1814

Thank you for that link.  It helps.

I tried doing something similar to the original questioner's task, and got an error message. 

What I wanted to do was to put the filenames in the caption, but with some text preceding the filenames.  So first I did:

exiftool "-IPTC:Caption-abstract=my text " .

This processed as expected.  Then I did

exiftool "-IPTC:Caption-abstract+<filename" .

But for each file, I got:

Warning:  Shift value for IPTC:Caption-Abstract is not a number - FILE
Warning:  No writable tags set from FILE

What is my error?  Is there some other method to prepend/append text?

Thanks for your help and patience!

Phil Harvey

You do it like this:

exiftool "-IPTC:Caption-abstract<my text ${filename}" .

You can embed any tag you want in this string.  This is explained towards the end of the -tagsFromFile description in the application documentation.

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

laura1814

Beautiful, thank you!

I appreciate your giving me the exact syntax.  I don't really know what the various symbols mean, so this helps a lot (and I've learned quite a bit just from this thread and its simple examples).  I will try studying the -tagsFromFile documentation (although a cursory glance wasn't very intelligible to me, in my ignorance). 

Thanks again for your help and your patience!