feoblog icon indicating copy to clipboard operation
feoblog copied to clipboard

Strip "Media Group UUID" exif from JPEG images

Open NfNitLoop opened this issue 2 years ago • 1 comments

Scenario:

  • User has an HEIC image on their phone.
  • User attaches it to a post.
  • Safari on iOS automatically converts the HEIC image to JPEG.
  • Instead of re-using the "Media Group UUID" from the HEIC, it creates a new, random UUID.

If the user ever uploads the image again, it has different file contents, thus a different hash, and breaks content-addressable store. Leads to:

  • needless duplication of images.
  • inability to (re)attach an image at a later time if uploading goes wrong. (i.e.: #120)

NfNitLoop avatar Jun 15 '23 05:06 NfNitLoop

Brainstorming:

Q: Should I just strip all exif data out of images?

A: No. If I'm working on a computer and I drag a file in, I may want the exif metadata to stay present. We shouldn't modify files without users' consent. (Though, we may want a separate feature to warn people about exif metadata. GPS in particular.)

… But Safari (only on iOS?) creating images w/ different UUIDs with every upload feels more like a bug. So maybe limit the stripping to

  • Just that field (Maybe replacing it with all 0s)
  • Only on iOS

NfNitLoop avatar Jun 19 '23 01:06 NfNitLoop