Photo Exif data is removed when image is rotated #39

Closed
opened 2018-07-27 16:34:20 +01:00 by aheathershaw · 4 comments
Owner

I've recently discovered that the GD library removes Exif data from the image and replaces it with its own when an image is rotated and saved back out again.

Now we can "re-analyse" photos, we need the original Exif data available, so we shouldn't be modifying the original image.

Instead, the thumbnail generation should be looking at the Orientation flag, and rotating the thumbnail, not the original.

I've recently discovered that the GD library removes Exif data from the image and replaces it with its own when an image is rotated and saved back out again. Now we can "re-analyse" photos, we need the original Exif data available, so we shouldn't be modifying the original image. Instead, the thumbnail generation should be looking at the Orientation flag, and rotating the thumbnail, not the original.
aheathershaw added this to the Version 2.1.0 milestone 2018-07-27 16:34:20 +01:00
aheathershaw self-assigned this 2018-07-27 16:34:20 +01:00
aheathershaw added the
bug
label 2018-07-27 16:34:20 +01:00
Author
Owner

This also means when manually rotating/flipping images, we can't touch the original - only regenerate the thumbnails. When the original is viewed, we apply the transformations again stored in the database.

This also means when manually rotating/flipping images, we can't touch the original - only regenerate the thumbnails. When the original is viewed, we apply the transformations again stored in the database.
Author
Owner

After thinking this through a bit more, we now store the Exif data in MySQL (as of meta data V2) therefore as long as this data isn't overwritten during a re-analyse, we just use that instead of going back to the original image.

This minimises the changes as the rest of BT's behaviour can stay as it is now.

When an image is replaced, the stored Exif data must be removed and replaced with that from the new image.

After thinking this through a bit more, we now store the Exif data in MySQL (as of meta data V2) therefore as long as this data isn't overwritten during a re-analyse, we just use that instead of going back to the original image. This minimises the changes as the rest of BT's behaviour can stay as it is now. When an image is replaced, the stored Exif data must be removed and replaced with that from the new image.
Author
Owner

Any images that have been rotated (either manually or automatically using the Exif Orientation flag) must be re-uploaded using the new "replace image" function in 2.1 to restore the correct Exif data for future use/analysis.

Any images that have been rotated (either manually or automatically using the Exif Orientation flag) must be re-uploaded using the new "replace image" function in 2.1 to restore the correct Exif data for future use/analysis.
Author
Owner
Migrated from https://github.com/andysh-uk/blue-twilight/issues/39
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: aheathershaw/blue-twilight#39
No description provided.