Able to code a change in exiftool, but unable to do this in a config file

Started by capricorn, June 15, 2025, 10:40:56 AM

Previous topic - Next topic

capricorn

Background:
I have been able to find new information to an existing Olympus tag and decode it. (for newer models, there is a 6th byte in addition the existing 5 specificed for "DriveMode")

Before submitting this information, I wanted to share it with some more people to test and verify this (using other models than those that I have access to). I thought providing a config file would be the best way to do so.

I studied the example.config file and tried using a ChatGPT-generated template. After two hours, I gave up and quickly and easily modified the existing Olympus.pm file on my local installation.

Can anyone point me to what is wrong with the config file?

Knowing how to add print conversions for unknown tags would come in very handy for further decoding work.

Attached is the relevant portion from Olympus.pm (DriveMode.pm, basically added lines 8-40) and the config file I used.

Many thanks
Karsten

StarGeek

This will require Phil's attention, as I have never looked into creating a user defined MakersNote before, and it looks quite complex.

Quote from: capricorn on June 15, 2025, 10:40:56 AMI studied the example.config file and tried using a ChatGPT-generated template.

<Western old timer voice>
Well, there's yer problem right there.

ChatGPT and other AIs hallucinate badly when it comes to exiftool. Part of it is that there is a lot of information to deal with when it comes to metadata, and part of it is that the AIs don't understand that any modifications to exiftool need to be Perl code.
"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

Here is how the config file should look (you were over-thinking it -- 0x600 is a tag. No SubDirectory was required.).

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

capricorn

Many thanks for your immediate response, Phil!

If only I could get exiftool to accept and understand this file.

I have a put the "exiftool_config" file in my user home, in the directory where exiftool has been installed, in the current directory, with and without preceeding ".". Using the "-config" option doesn't work either. Changed DriveMode" to "ShootingMode" to avoid potential collision with an existing tag name. Nothing. exiftool just seems to silently ignore this file.

To rule out a general problem on my end I used the example config from https://exiftool.org/config.html and this one works.

Appended the "ShootingMode" definition at the end of the config sample file. The sample config tag definitions can be seen in output, ShootingMode not.

- Karsten

StarGeek

Check to make sure the config file is in ascii/UTF8 and not UTF16.
exiftool -MIMEEncoding exiftool_config

When you use the -Config option, is there any error/warning output?

For example, the -config option must be the very first option and the output will say this if it is not
Ignored -config option (not first on command line)
Using the -config option, have you tried using the full path to the config file?

The config file doesn't throw an error for me, but I don't have a sample file to test further.
"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

capricorn

Quote from: StarGeek on June 16, 2025, 10:31:47 AMUsing the -config option, have you tried using the full path to the config file?
A copy of the config file is in the current directory, I tried w/ and w/o the full path:
[D:\EXIF\Drive Mode]exiftool -config "D:\EXIF\Drive Mode\exiftool_config" -ShootingMode P6100146.JPG

[D:\EXIF\Drive Mode]exiftool -config exiftool_config -ShootingMode P6100146.JPG

Quote from: capricorn on June 16, 2025, 09:35:36 AMAppended the "ShootingMode" definition at the end of the config sample file. The sample config tag definitions can be seen in output, ShootingMode not.

I interpret this behavior that there is something not okay with the DriveMode / ShootingMode definition, so that exiftool ignores this.

Phil Harvey

OK, I tested it this time.  It didn't work because the tag is in the CameraSettings table, not Main.

Change "Main" to "CameraSettings" and it should work.

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

capricorn

Works! Great, thank you!

Also, thanks for pointing out that this was linked to tables, so I could fix it myself for tags related to FocusInfo (AntiShockWaitingTime) and AFInfo (CAFSensitivity).

I have a few more settings on my list to look at before I will bundle a package and send it over to you.

- Karsten