Skip to content

Half of specific PNG image fails to load on .NET 6 #1728

@PJB3005

Description

@PJB3005

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

I have this specific PNG image of which the bottom half gets cut off when I try to load it with ImageSharp. It only happens on .NET 6 (preview 6), .NET 5 is fine. No other editor/viewer I tried it with (paint, paint.net, krita, windows photo viewer (old and windows 10 one), chrome, firefox) fails to load this image.

here is the image:

000000drizzletest (5C8E5A1B4B577E68A21E1384B5A11C5B1A38B59AC5210C583C6D577CCAF96E23 SHA256 hash but github shouldn't change it on upload).

If I load and save this with ImageSharp, I get the following result:
foo

Re-saving the image by, for example, running it through optipng magically fixes the problem.

Steps to Reproduce

Download the image, then run it through some C# code like this:

var img = Image<Bgra32>.Load("000000drizzletest.png");

img.SaveAsPng("foo.png");

System Configuration

  • ImageSharp version: 1.0.3
  • Other ImageSharp packages and versions: None
  • Environment (Operating system, version and so on): Windows 10 Pro 19042.1110
  • .NET Framework version: .NET 6
  • Additional information: If you're wondering what made this cursed PNG file, it's an img Xtra for Adobe Director. No, you don't want to know.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions