Magick.NET version
14.14.0
Environment (Operating system, version and so on)
Windows 11
Description
When converting a System.Drawing.Bitmap into a MagickImage in Magick.NET, the EXIF tag ImageHistory (0x9213) is assigned a different ExifIfd compared to when the same image is loaded directly using Magick.NET.
Specifically:
When loading the image directly with new MagickImage("file.jpg"), the tag ImageHistory is assigned to ExifIfds.Exif.
When loading the image through System.Drawing.Bitmap and then converting it to MagickImage, the same tag is assigned to ExifIfds.Ifd0.
The tag value itself remains identical in both cases, but the ExifIfd differs depending on the input pipeline.
This inconsistency indicates that EXIF IFD assignment is not normalized across different loading paths. The Bitmap-based conversion path appears to lose or ignore original EXIF IFD grouping information, resulting in a fallback or default assignment to Ifd0.
As a result, metadata comparisons that include ExifIfd (for example equality checks between tags or profiles) will fail even though the underlying EXIF data is identical.
The issue is specific to the conversion pipeline involving System.Drawing.Bitmap and does not occur when images are loaded directly through Magick.NET.
Steps to Reproduce
Create a MagickImage.
Set the exif tag "ImageHistory" to a value.
Save to Test.jpg
=> Alternatively, you can use attached Test.jpg file, which contains some ImageHistory exif data.
Create a System.Drawing.Bitmap from this file.
Convert to MagickImage.
Call GetExifProfile().GetValue(ExifTag.ImageHistory) => you get null.
ImageHistory is present if exifProfile, with the correct tag value (0x9213) but ExifIfds set to "Ifd0" instead of expected "Exif"
Images
Test.jpg
Magick.NET version
14.14.0
Environment (Operating system, version and so on)
Windows 11
Description
When converting a System.Drawing.Bitmap into a MagickImage in Magick.NET, the EXIF tag ImageHistory (0x9213) is assigned a different ExifIfd compared to when the same image is loaded directly using Magick.NET.
Specifically:
When loading the image directly with new MagickImage("file.jpg"), the tag ImageHistory is assigned to ExifIfds.Exif.
When loading the image through System.Drawing.Bitmap and then converting it to MagickImage, the same tag is assigned to ExifIfds.Ifd0.
The tag value itself remains identical in both cases, but the ExifIfd differs depending on the input pipeline.
This inconsistency indicates that EXIF IFD assignment is not normalized across different loading paths. The Bitmap-based conversion path appears to lose or ignore original EXIF IFD grouping information, resulting in a fallback or default assignment to Ifd0.
As a result, metadata comparisons that include ExifIfd (for example equality checks between tags or profiles) will fail even though the underlying EXIF data is identical.
The issue is specific to the conversion pipeline involving System.Drawing.Bitmap and does not occur when images are loaded directly through Magick.NET.
Steps to Reproduce
Create a MagickImage.
Set the exif tag "ImageHistory" to a value.
Save to Test.jpg
=> Alternatively, you can use attached Test.jpg file, which contains some ImageHistory exif data.
Create a System.Drawing.Bitmap from this file.
Convert to MagickImage.
Call GetExifProfile().GetValue(ExifTag.ImageHistory) => you get null.
ImageHistory is present if exifProfile, with the correct tag value (0x9213) but ExifIfds set to "Ifd0" instead of expected "Exif"
Images
Test.jpg