Closed luipir closed 1 day ago
ok, more debug
In [20]: with ExifTool() as et:
...: et.execute(*['-Exif:GPSLatitude="41 55 23"', "./notag_cog.tif"])
...: print(et.last_stderr)
...:
Warning: Argument ""41 55 23"" isn't numeric in abs in GPS:GPSLatitude (ValueConvInv)
Nothing to do.
e.g. in this case I've to convert value in a float number! in fact this works
In [25]: with ExifTool() as et:
...: et.execute('-Exif:GPSLatitude=41.555', "./notag_cog.tif")
...: print(et.last_stderr)
...:
In [26]: !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 33' 18"
is there a reason to have this different behaviour respect CLI use? or better question, is there a way to align use of API to CLI adding some more parameter?
Adapted the code to the behaviour and overridden this "issue" (if any). BTW I leave open the ticket as a form to add documentation.
is the # modifier that allow to disable print convertion? as explained into:
A # may be appended to the tag name to disable the print conversion on a per-tag basis (see the -n option). This may also be used when writing or copying tags.
Copy/Paste from my response on the exiftool forums
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.
This is the wrong place for this report, but I suspect the problem is that you shouldn't be using quotes inside arguments passed to et.execute
Ah, good catch Phil.
From the PyExiftool docs
Parameters which need to be quoted on the command line generally do not need to be quoted in the parameters to PyExifTool. In fact, quoting may have unintended behavior.
Houch! so sorry @StarGeekSpaceNerd @boardhead , I didn't realised that pyexiftool was not belonging to the project!
Describe the bug 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
any hint? 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
Desktop (please complete the following information): Ubuntu 24.04.1 LTS 0.27.6 (installed via apt)