Yellow-Dog-Man / FreeImage

Customized fork of the FreeImage library
Other
11 stars 6 forks source link

feat(exif): Enable EXIF Writing using FIMD_EXIF_RAW #14

Closed ProbablePrime closed 4 months ago

ProbablePrime commented 4 months ago

FreeImage keeps two separate copies of Exif Metadata in memory:

With this you can use the following to clear and persist that "clearing" of the exif data on a FreeImage image:

ImageMetadata imageMetadata = new ImageMetadata(dib, true, true);
var model = imageMetadata[FREE_IMAGE_MDMODEL.FIMD_EXIF_RAW];
model.DestroyModel();

When you then write that subsequent image to a file, the file will not contain any EXIF data!

This is based on:

As this change doesn't touch the native library, you won't need to compile that again. This is a purely .NET change. -

ProbablePrime commented 4 months ago

Now a demo here: https://github.com/ProbablePrime/FreeImage-WipeExif/blob/main/Program.cs

ProbablePrime commented 4 months ago

While this is straight forward, I'm still wanting at least 1 team review from Geenz or Froox. Due to the nature of free-image being very complicated.

Geenz commented 4 months ago

Looks good to me.

ProbablePrime commented 4 months ago

Ok, I'll roll a new version thanks!, this unblocks some work im doing!

ProbablePrime commented 4 months ago

More context now available here: https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2015