Rename DNG if JPG has Rating 1

Started by peho, May 15, 2023, 11:58:54 AM

Previous topic - Next topic

peho

Due to not being able to update my Samsung S10 DNG-files, I would like to rename a DNG file if the corresponding JPG has Rating 1.
Found this regarding Samsung DNG
https://exiftool.org/forum/index.php?topic=9361.msg48387#msg48387

The preferred way, is to go through all DNG in a folder and check the corresponding JPG and if Rating is 1, do rename.
Just rename is easy:
-ext dng -TagsFromFile %d%f.jpg -FileName<%f-rate$Rating.%e -overwrite_original_in_place

How do I do the if-statement referencing to the Rating in JPG?

Ive tested a lot of alternatives with TagsFromFile, SrcFile and if, but didn't found anything that worked.

I only have ExifTool v12.00 on my Samsung S10 in FastTagger app. Can't use -FileNUM option.

Phil Harvey

The only way to use tags from a different file in the -if condition is with the new -fileNUM option.  Otherwise, tags in -if expressions are always from the target file. 

The way around this is to first copy the Rating to the target file.  Another work-around is mentioned in the documentation:

            4) The condition may only test tags from the file being processed.
            To process one file based on tags from another, two steps are
            required.  For example, to process XMP sidecar files in directory
            "DIR" based on tags from the associated NEF:

                exiftool -if EXPR -p '$directory/$filename' -ext nef DIR > nef.txt
                exiftool -@ nef.txt -srcfile %d%f.xmp ...


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

peho

Thanks.
And thankyou for keeping this great app up2date.

Phil Harvey

I'll also update that quote in the documentation because now the -fileNUM option is the way to do it.

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

peho

 :)
Now I just have to convince the developer to update exiftool in the android app from v12.00...