Allow returning results without group name (a way to disable `-G`)
Hi there! First off, thanks for this library, it has made my life infinitely easier!
I'm not sure if this is already possible, but I wasn't able to figure it out from the docs/playing with params myself.
Is there a way to use the library so that results are returned without the groupname prefix?
i.e. ExposureTime instead of EXIF:ExposureTime
When using exiftool directly, if the group name is not specified, it returns a value using the default group for that tag (at least that's what I understand from here).
I get the same result running exiftool directly:
$> exiftool -s -G -j -ExposureTime file.jpg
[{
"SourceFile": "file.jpg",
"EXIF:ExposureTime": "1/500",
"MakerNotes:ExposureTime": "1/523"
}]
Or using the python library:
with exiftool.ExifToolHelper() as et:
res = et.get_tags(["file.jpgl"], {"tags": ["ExposureTime"]})
print(res)
However, running:
$> exiftool -s -j -ExposureTime file.jpg
[{
"SourceFile": "file.jpg",
"ExposureTime": "1/500"
}]
returns what I'm looking for (i.e. only the default value for the specified tag). Is there a way to get the same behaviour in pyexiftool?
I've attached the image I was using in case that's helpful:
I'm not sure if this is already possible, but I wasn't able to figure it out from the docs/playing with params myself.
Is there a way to use the library so that results are returned without the groupname prefix? i.e.
ExposureTimeinstead ofEXIF:ExposureTime
@ninas the answer is yes, it's already provided. As per the docs https://sylikc.github.io/pyexiftool/reference/1-exiftool.html#exiftool.ExifTool.init , you can initialize with the parameter common_args. The default is ['-G', '-n'], so you can just instantiate a pyexiftool object with common_args=['-n'] and that's it!
Ah, missed that, thanks for responding!