Custom Exif metadata tags #1426
-
I noticed that some Exif data was missing from some png & jpg after Image.Save(). I had a quick poke through the source - it seems that ImageSharp only supports the Exif tags formally specified in Exif v2? Looking in the debugger I can see that ImageSharp can read all the non-standard tags, but when saving an image it seems to only writes the standard spec tags - even if the metadata is not edited. Is it currently possible for ImageSharp to save unknown Exif tags when saving? Even if I create my own ExifTag class, it looks to me like ExifTags.GetPart() will prevent it writing? Image metadata makes my head hurt 🤯 NB: I've used ImageProcessor.net for a while (thank you!), but didn't realise that ImageSharp is where it's at. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Yes. We only support the 2.2 standard (We need to bump support to 2.3.2). This is by design. We do not want to continue to propagate bad EXIF properties that doe not conform to the specification. We do the same for raw jpeg decoding. We've had to put in lots of fail safes to ensure badly encoded jpegs can be decoded but we would never encode them in any manner that does not conform to the specification.
I'm not sure I follow. Are you saying you are not able to create new valid tags? P.S. ImageProcessor and ImageSharp are not related in any way and I find it a bit of a head scratcher why people continue to believe that they are. The only commonality is that I own both repositories. |
Beta Was this translation helpful? Give feedback.
-
I'm torn on this issue! Generally I verge on fanatic about adhering to specs so I agree with your stance. However the Exif standard is not well adhered to even by the camera manufacturers yet alone the various image-manipulation software over the years (a good reference list is https://exiftool.org/TagNames/EXIF.html). So due to the vast number of images in the wild, there are a significant number which contain information in non-standard Exif fields, so it seems rude to just delete it! I suggest perhaps an ImageSharp option to preserve non-standard but otherwise well formed Exif tags (at users risk). For my personal use case, you have prompted me to look at migrating non-standard Exif data somewhere "legal" - perhaps a custom XMP namespace.
I can create new valid tags fine - I was just hoping there was an easy way to add custom tag class without significantly changing the metadata writing class. |
Beta Was this translation helpful? Give feedback.
Yes. We only support the 2.2 standard (We need to bump support to 2.3.2).
This is by design. We do not want to continue to propagate bad EXIF properties that doe not conform to the specification. We do the same for raw jpeg decoding. We've had to put in lots of fail safes to ensure badly encoded jpegs can be decoded but we would never encode them in any manner that does not conform to the specification.
I'm not sure I follow. Are you saying you are not able to create new valid tags?
P.S. ImageProcessor and ImageSharp are not related in any way and I find it a bit of a head scratcher wh…