Open Dobatymo opened 1 year ago
I'm using it for this:
corrected = photo.exif_autotransform()
This used to preserve and update the Exif.
jpegtran -outfile foo2.jpeg -rotate 90 foo.jpeg
loses the Exif as well.
jpegtran -rotate 90 -copy all -outfile foo2.jpeg foo.jpeg
copies it, but the orientation needs updating.
Looking thru the code, not sure how it ever worked. There doesn't seem to be any affordance for the copy parameter, and it isn't a member of the transform options. Maybe the default in the C code changed at some point, but doesn't look recently updated either.
I had to change my code to a double subprocess.call of jpegtran and exiftool. :-(
Not sure why though. According to libjpeg-turbo
TJXOPT_COPYNONE
needs to be set to not copy it.Test using the test file in the test folder.
test-save.jpg
keeps the metadata, the other two not.