config file question

Started by ekkidee, July 06, 2018, 03:04:21 PM

Previous topic - Next topic

ekkidee

I am stumped by this one. I have the following in a config file --

    'Image::ExifTool::Composite' => {
# 180706: xuid6: Added. See https://exiftool.org/forum/index.php?topic=1648.0
        xuid6 => {
            Require => 'imageUniqueID',
            ValueConv => 'substr($val,-6)',
        },

# 180706: PhysicalImageSize. See https://exiftool.org/config.html
        PhysicalImageSize => {
            Require => {
                0 => 'ImageWidth',
                1 => 'ImageHeight',
                2 => 'XResolution',
                3 => 'YResolution',
                4 => 'ResolutionUnit',
            },
            ValueConv => '$val[0]/$val[2] . " " . $val[1]/$val[3]',
            # (the @prt array contains print-formatted values)
            PrintConv => 'sprintf("%.1fx%.1f $prt[4]", split(" ",$val))',
        },
    },


It's the xuid6 tag I am after. I want it to return the last six chars of imageUniqueID, which I have confirmed exists. The second composite tag, PhysicalmageSize, was added by me as an example and to confirm there were not issues elsewhere, and it works beautifully. But for some reason -xuid6 does not work. I have tried using something other than 'imageUniqueID' (-filename, -usercomment) and I have used "Desire". All return with the dreaded "-".

Do you see anything wrong with this? Is there a way to force exiftool to throw an error if you request a tag that it does not know about or does not exist?

Thanks!

StarGeek

The tag name you Require is case sensitive.  Change it to ImageUniqueID
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

ekkidee

No luck ... same result. FWIW I have used other more obvious tags in Require and nothing seems to be recognised.

exiftool -config $exifToolConfig -T -filename -xuid6 .


$exifToolConfig is set correctly ....


StarGeek

I'm not sure what's wrong, some detail is missing.

I copy/pasted your code into my config file, just the xuid6 part, corrected ImageUniqueID, and it worked correctly for me.

Have you tried it on the command line directly without using a variable for the config file? 

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Your config file works for me after capitalizing the "I".  (Attached is the exact version I used.)

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

ekkidee

#5
Yes Phil, your version worked. There is something wrong (elsewhere) in my config file.

Instead of trying to fix my original config, I will simply copy over adapted bits and pieces until it's all in there.

Again, thank you and your supporters for help with this issue. exiftool is a wonderful program and I use it extensively.

ETA - I did figure it out, I believe ... I had two sections of

'Image::ExifTool::Composite'


and apparently the second was taking precedence over the first. My sloppy bad.

Phil Harvey

Quote from: ekkidee on July 11, 2018, 09:51:20 PM
apparently the second was taking precedence over the first.

Yes.  You aren't the first to fall for this one.

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