Skip to content

EXIF Orientation data not loading #1809

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

Open
salexander6 opened this issue Mar 13, 2025 · 2 comments
Open

EXIF Orientation data not loading #1809

salexander6 opened this issue Mar 13, 2025 · 2 comments

Comments

@salexander6
Copy link

Magick.NET version

14.5.0

Environment (Operating system, version and so on)

Windows 11 Home, version 24H2, OS build 26100.3194

Description

I’m seeing a small percentage of images with EXIF Orientation data that isn’t loading.

When I use exiftool (13.24) to inspect the image I see

> exiftool .\sample.jpg -g -G
[EXIF] Orientation : Rotate 90 CW

When I view the same image in Windows File Explorer I see the Orientation data is being used.

Image

But when I load the image using Magick.net the Orientation data is not accessible.

Steps to Reproduce

using var image = new MagickImage(@"C:\temp\sample.jpg");
var exifProfileFromImage = image.GetExifProfile();
$"EXIF: {exifProfileFromImage}".Dump();
$"Dimensions: {image.Width}x{image.Height}".Dump();

// EXIF: (null)
// Dimensions: 3072x4080

I'll also include the exiftool output for 27 images that reproduce this issue, in case it helps.

bad-images-exif.txt

Images

Image

@dlemstra
Copy link
Owner

I suspect that other tooling is doing something differently than reading the app marker segments. I can see there is exif data in the file but it is not read by the jpeg library that we are using to read the file. I suspect that other tooling just reads through the file until it finds an Exif header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@salexander6 @dlemstra and others