ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: ekkidee on July 06, 2018, 03:04:21 PM

Title: config file question
Post by: ekkidee on July 06, 2018, 03:04:21 PM
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!
Title: Re: config file question
Post by: StarGeek on July 06, 2018, 03:26:32 PM
The tag name you Require is case sensitive.  Change it to ImageUniqueID
Title: Re: config file question
Post by: ekkidee on July 06, 2018, 03:34:03 PM
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 ....

Title: Re: config file question
Post by: StarGeek on July 06, 2018, 09:06:31 PM
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? 

Title: Re: config file question
Post by: Phil Harvey on July 09, 2018, 07:28:18 AM
Your config file works for me after capitalizing the "I".  (Attached is the exact version I used.)

- Phil
Title: Re: config file question
Post by: ekkidee on July 11, 2018, 09:51:20 PM
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.
Title: Re: config file question
Post by: Phil Harvey on July 13, 2018, 07:25:07 AM
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