ente-io / ente

Fully open source, End to End Encrypted alternative to Google Photos and Apple Photos
https://ente.io
GNU Affero General Public License v3.0
15.79k stars 813 forks source link

Editing or copying an image removes EXIF data #835

Open windmueller opened 10 months ago

windmueller commented 10 months ago

Describe the bug When an image is edited or copied, the resulting image will have no EXIF data.

To Reproduce Steps to reproduce the behavior:

  1. Open an image and verify that is has EXIF data
  2. Click "edit"
  3. Select "Save copy" or "Rotate"
  4. Observe that the new image does not contain any EXIF data

Expected behavior The original EXIF data should be preserved as best as possible.

Smartphone (please complete the following information):

vishnukvmd commented 8 months ago

FWIW, the reason we are retaining the original image, and creating a copy of the edited image is because writing back EXIF into photos is difficult, depending on the file format.

One approach we could take is to not actually edit the photo, but maintain transformations as metadata in the backend, and apply the transformations when the photo is being viewed. But even with this approach, the issue with writing back EXIF to the photo when downloaded would remain.

windmueller commented 7 months ago

To be honest, I do not like the approach of "transformations as metadata". What would this mean when for the CLI export-function?

Are all file formats difficult when writing EXIF tags? I would assume that most smartphone pictures are JPEG files. So it does not have to be a "we support all tags for all formats" solution, but rotating a JPEG lossless would be an important feature in my opinion.

vishnukvmd commented 7 months ago

What would this mean when for the CLI export-function?

Whenever a file is getting downloaded, the client (CLI / desktop / mobile) would have to apply the transformations.

The more I think about this approach, the more complex it feels.

most smartphone pictures are JPEG files

Surprisingly large amount of photos clicked are now in HEIC (100% on iOS, and a non-trivial % on newer Android devices), where there is no straight forward way to update the EXIF.

rotating a JPEG lossless

Totally agree that we should support such use cases, without creating a duplicate. What we could do is write back to the EXIF when we can, and create a duplicate when we can't. The concern there is inconsistent UX.

windmueller commented 7 months ago

The more I think about this approach, the more complex it feels.

To be honest, I did not like this when it appeared in Google Photos because it does not feel like I have total control over my photos because it is not transparent who is modifying images and when. With ente, this has improved a lot.

Surprisingly large amount of photos clicked are now in HEIC (100% on iOS, and a non-trivial % on newer Android devices),

That I did not know but it is not very surprising that you are way better informed in this topic. :)

I just tried to enable HEIC in my stock camera app (Google Pixel 7) but new photos are still written as JPEG. But I do not mind, JPEG has been good enough for decades for me.

What we could do is write back to the EXIF when we can, and create a duplicate when we can't.

Sounds like a good solution!