Can options be set after the call to ImageInfo?

Started by Martin B., October 03, 2023, 03:42:37 PM

Previous topic - Next topic

Martin B.

Which options can be set after the call to ImageInfo() but before a call to GetValue()?

https://metacpan.org/pod/Image::ExifTool#GetInfo says the following options are effective, but I'm not sure when I need to set the options in order for them to be effective:
QuoteThe following options are effective in the call to "GetInfo":

Charset, CoordFormat, DateFormat, Duplicates, Escape, Exclude, Filter, Group#, GlobalTimeShift, Lang, ListItem, ListJoin, PrintConv, QuickTimeUTC (conversion to local time), Sort (if a tag list reference is given) and StrictDate.

For instance, will the following generally return two different values of CreateDate?
Or do I need to set the option and call ImageInfo() again? This takes more computing time...
$exifTool = new Image::ExifTool;
$exifTool->ImageInfo('file.mov');

$exifTool->Options(QuickTimeUTC => 0);
my $create_date = $exifTool->GetValue('CreateDate');

$exifTool->Options(QuickTimeUTC => 1);
my $create_dateUTC = $exifTool->GetValue('CreateDate');
In my tests, I'm getting inconsistent values across files coming from different cameras, but https://metacpan.org/pod/Image::ExifTool#Options says the CR3 files always use UTC times, so it could be that, but I thought I'd ask here.

My example is specific to QuickTimeUTC, but my question is really about this bit of documentation for all options.

Thanks!

StarGeek

Quote from: gamin on October 03, 2023, 03:42:37 PMIn my tests, I'm getting inconsistent values across files coming from different cameras, but https://metacpan.org/pod/Image::ExifTool#Options says the CR3 files always use UTC times, so it could be that, but I thought I'd ask here.

I believe that in CR3 files the integer based Quicktime date/time tags are UTC and that the QuicktimeUTC option is automatically on.  You will get the same results on a CR3 file regardless of if QuicktimeUTC is set to 0 or 1.
"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

Martin B.

#2
Thanks, I kind of expected that for CR3 files, but I don't know for MOV files (the example I provided), and certainly not for non-Canon files.

In any case, my question was more about when I can set the options: do I need to call Options() before calling ImageInfo() or can I do it before GetValue()? My question is not specific to the QuickTimeUTC option. If I'm not clear, perhaps the sample code I provided will better illustrate what I mean.

I now realize I had quoted, in my original post, the documentation for GetInfo() while I meant GetValue() (the difference isn't significant to my question):
https://metacpan.org/pod/Image::ExifTool#GetValue says:
QuoteThe following options are in effect when "GetValue" is called:

Charset, CoordFormat, DateFormat, Escape, Filter, GlobalTimeShift, Lang, ListItem, ListJoin, PrintConv, QuickTimeUTC (conversion to local time), StrictDate and TimeZone.

Thanks!

Phil Harvey

First, you don't need to be calling ImageInfo if you aren't using the return tags.  Just call ExtractInfo then GetInfo. (Which is what ImageInfo does internally.)

Looking at the documentation for ExtractInfo, it says "QuickTimeUTC (enforced 1904 time zero)".  So the 1904 epoch is enforced only if QuickTimeUTC is set before this call.  GetValue says "QuickTimeUTC (conversion to local time)", so the conversion to local time is done only if QuickTimeUTC is set for this call.

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

Martin B.

Thanks Phil for the clarification and pointers!
I wasn't looking at the right place for the answers to my questions.