Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 9, 2024

Commits on May 8, 2024

  1. feat(exif): Enable EXIF Writing using FIMD_EXIF_RAW

    FreeImage keeps two separate copies of Exif Metadata in memory:
    - One is used/found in MDM_EXIF_MAIN and its extensions(e.g. MDM_EXIF_GPS).
    - Another one is used when files are actually written that support the EXIF Format.
    - In some cases you want to access, the raw data.
    - A good example of this is when using MetadataModel.DestroyModel to wipe EXIF data on an image that you wanted persisted if that file is exported again from FreeImage.
    - DestoryModel was also corrected to DestroyModel, this will result in a breaking change version but that's worth it!
    
    With this you can use the following to clear and persist that "clearing" of the exif data on a FreeImage image:
    ```cs
    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:
    - https://sourceforge.net/p/freeimage/discussion/36111/thread/2d087f91/ where i discovered FIMD_EXIF_RAW
    - https://sourceforge.net/p/freeimage/discussion/36111/thread/8233f5bc/ where I learnt how you might use it.
    
    As this change doesn't touch the native library, you won't need to compile that again. This is a purely .NET change.
    -
    ProbablePrime committed May 8, 2024
    Configuration menu
    Copy the full SHA
    91ef4e6 View commit details
    Browse the repository at this point in the history