WPF BitmapImage complains about EXIF corrupt metadata

David Jones 0 Reputation points

I am using a Image control to show/load images in WPF.

My jpg images are exif files. My WPF program is complaining about corrupt exif metadata header and dont show that image in image control. There is no problem opening this image else where like in mspaint or in photos app or in browser etc.

I tried exiftool, and it says warning - malformed Exif APP1 segment

I tried to investigate more regarding APP1 segment format,

I open my image in hex, it says:

FF D8 FF E1 - App1 Segment

00 BC - length of metadata header

45 78 69 66 00 00 - exif

49 01 01 2C 01 2C 00 00 - tiff header

tiff header first two bytes either should be 49 49 (Intel II) or 4d 4d (Motorolla)

What is 49 01 in my image? Is it the reason of corruption message?

My WPF program is breaking and not showing any image due to this. ExifTool is showing it as warning: malformed exif app1 segment.

Image is rendered fine everywhere else in browser, in mspaint or in any other imaging tool.

Need little help here.

I am using .NET framework 4.6.1, Also tried it in .NET 4.8 framework with same error.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,709 questions
{count} votes