Access variable defined outside of user defined tag

Started by StarGeek, October 19, 2018, 06:37:19 PM

Previous topic - Next topic

StarGeek

I just want to verify that I understand this correctly.

If I define a variable, in this case a large look up hash, outside of the tag I'm creating, in order to access it I have to use ValueConv => sub instead of ValueConv => q, correct?

I remember having to work thought this once before and I'm currently heading the same way and wanted to verify before I get to deep.
"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

I think you could access it via an enum too, but you couldn't use a file-scope variable defined by "my".   It should work to define a variable like this in the config file:

$Image::ExifTool::UserDefined::MyVariable = <initial value>

Then use $Image::ExifTool::UserDefined::MyVariable in your enum.

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

StarGeek

Ok

In this case I think I'm going to call a subroutine to do the look up, as it's easier for me to understand.  And use ValueConv => sub for the more complicated stuff.
"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