jarun/imgp

non-retention of some EXIF metadata

sydb opened this issue · 5 comments

sydb commented
  • Fresh install of Ubuntu 19.04 (actually, running off live USB)
  • Installed version 2.6 via apt-get install imgp after checking the “Community-maintained free and open-sourced software (universe)” box in Software & Updates.
  • Ran imgp -x 1200x800 -r -z /path/to/input/ (The -z switch was useless as I do not konw where the log went.)
  • Got reduced size versions blazingly fast (yay!)
  • BUT quite a few of the EXIF fields were lost.
  • See attached files for list of original EXIF fields and those in resulting _IMGP file, and a diff -y between them that has been modified to be easier to read.
  • Also ran quick test running v. 2.6 from the repository with ./GITCLONED_imgp/imgp -x 1200x800 -r /path/to/input/; only checked “Attribution Name” field, but it was missing. I presume the rest were, too.

TSTJPEG_orig_exif_fields.txt
TSTJPEG_IMGP_exif_fields.txt
TSTJPEG_exif_field_diff.txt

jarun commented

The exifdata is copied here: https://github.com/jarun/imgp/blob/master/imgp#L260

and restored here: https://github.com/jarun/imgp/blob/master/imgp#L436

It should be pretty straight how to preserve exif data with Pillow. Not sure if the method has changed with any newer version of Pillow. Can you debug and figure out what's going wrong?

jarun commented

Can you follow the first example and see if it helps: https://hhsprings.bitbucket.io/docs/programming/examples/python/PIL/ExifTags.html

jarun commented

From the following line in the first example it seems what we are doing currently is the same:

https://hhsprings.bitbucket.io/docs/programming/examples/python/PIL/ExifTags.html

sydb commented

Last time I wrote a Python program was well over a decade ago, so I am not all that much help here. That said, I note that line 161 looks exactly the same as 260; and line 194 looks exactly the same as 436; and both look fine to my inexpert eyes. They both seem to do what the PIL/ExifTags example shows.

jarun commented

They both seem to do what the PIL/ExifTags example shows.

Yes, it doesn't look like an imgp issue. Please raise a defect on the PIL library you are using to address this.