News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Save preview image of .arw to .jpg with filename using XMP:Description field

Started by brockgs, September 27, 2021, 03:49:38 PM

Previous topic - Next topic

brockgs

I'd like to extract the PreviewImage from all .ARW files in a directory, save them as .JPG files and append the 'Description' from the source file's XMP file to the output filename.

Here's a non-working command that tries to express what I want to do:
exiftool -b -PreviewImage -w _${XMP:Description}.jpg -ext ARW .

So given the files photo1.ARW and photo1.XMP, when I run the command I would get the file photo1_MyPhotoDescription.jpg if "MyPhotoDescription" was the value of the Description field in the file photo1.XMP

Thoughts?

Thank you very much. I have been reading through the forums, checking out examples I can find, and haven't found anything quite like this. I'm sure it's very possible, I'm just having difficulty locating information about it.

StarGeek

You can't use tags as part of the name from the -w (-TextOut) option.  You'll have to run a second command using -TagsFromFile option to copy the Description to the new files Filename.

So extract with
exiftool -b -PreviewImage -w %f.jpg -ext ARW .

Then rename with
exiftool -TagsFromFile %f.arw "-Filename<_${XMP:Description}.jpg" -ext jpg .

Though test it out first using Testname instead of Filename, as I haven't tested it to see if it works.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).