CLI vs API mismatch behaviour

Started by ginetto, November 21, 2024, 06:13:41 AM

Previous topic - Next topic

ginetto

just open a new possible bug (or lack of deep knowledge of the tool)
https://github.com/exiftool/exiftool/issues/293

here a resume:
API behaviour (e.g. accepted parameter format) do not follow the same rule as CLI

To Reproduce
probably my lack of knowledge of the use of the API. I'm updating tags in a Tiff (COG formatted) and most of tags are updated correctly but some are ignored:
I did manually a test and this is the mismatch

In [10]: with ExifTool() as et:
    ...:     et.execute('-Exif:GPSLatitude="41 55 24"', "./notag_cog.tif")    <--- try to update the value via API
    ...:

In [11]: !exiv2 -pt  notag_cog.tif| grep -i GPSLatitude
Warning: Directory Image3 has an unexpected next pointer; ignored.
Exif.GPSInfo.GPSLatitudeRef                  Ascii       2  North
Exif.GPSInfo.GPSLatitude                     Rational    3  40deg 54' 23"    <--- remain the old value

In [12]: !exiftool -Exif:GPSLatitude="41 55 24"  notag_cog.tif                <--- update it via CLI with same parameter as API
    1 image files updated

In [13]: !exiv2 -pt  notag_cog.tif| grep -i GPSLatitude
    ...:
Warning: Directory Image3 has an unexpected next pointer; ignored.
Exif.GPSInfo.GPSLatitudeRef                  Ascii       2  North
Exif.GPSInfo.GPSLatitude                     Rational    3  41deg 55' 24"        <--- and via CLI it works

I tried to change from "41 55 24"" to "41deg 55min 24sec" but behaviour does not change.

p.s. sorry to use exiv2, just because allow me to write less parameters ;)

Expected behavior
API and CLI would be fine to have the same syntax management

Platform:
Ubuntu 24.04.1 LTS
0.27.6 (installed via apt)

StarGeek

et.execute isn't an exiftool API command. See the Image::ExifTool Perl Library Module.

It sounds like you're using PyExifTool. This was created by a 3rd party and isn't supported by the author of exiftool.

I did find this StackOverflow answer which seems like it might apply to your problem.
"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