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

Bug in .NET 6.0 which does not occur in .NET 5.0 when saving and loading png #1765

Closed
4 tasks done
synercoder opened this issue Sep 22, 2021 · 5 comments
Closed
4 tasks done

Comments

@synercoder
Copy link
Contributor

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 use a library to render PDF pages to image data. This data is in BGRA format. I then use Image.LoadPixelData<Bgra32>(bytes, width, height) to load the data, and then use the data.

In my unit test for this library I load the Bgra32 data after rendering, then save as PNG. Later on I open that file/stream again using Image.Load. It then throws an exception: SixLabors.ImageSharp.ImageFormatException : Bad method for ZLIB header: cmf=32.

Steps to Reproduce

I have saved the raw bgra data into a file, and made a minimal bug sample. The test run on GitHub actions can be found here: https://github.com/synercoder/ImageSharpNet6Bug/runs/3675201091?check_suite_focus=true

As can the minimal sample test: https://github.com/synercoder/ImageSharpNet6Bug/blob/main/ImageSharpBugTests/BugTests.cs

System Configuration

  • ImageSharp version: 1.0.3
  • Environment (Operating system, version and so on): Windows 10, bug also reproduced in GitHub Actions on Windows-latest
  • .NET Framework version: My pc & Github actions: 6.0.100-rc.1.21458.32
  • Additional information: Works in .NET 5.0 & images used in the raw file are from Pexels.com under the royalty-free license if that was any worry.
@antonfirsov
Copy link
Member

This is most likely duplicate of #1704, which got fixed by #1707.

Can you please check if it works with the nighlties?

@synercoder
Copy link
Contributor Author

Will do...

@synercoder
Copy link
Contributor Author

synercoder commented Sep 22, 2021

My searching(/understanding) of the issues was not enough apparently, also works currently on my pc & github actions. So I guess close me as duplicate.

@synercoder
Copy link
Contributor Author

@antonfirsov could my test case / image be a good addition to the imagesharp test suit (as a regression test mayhaps)? If so I could create/shape a PR this evening/tomorrow.

@synercoder synercoder reopened this Sep 22, 2021
@antonfirsov
Copy link
Member

Yeah #1707 went in without a test, a test case would be an addition we appreciate!

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

No branches or pull requests

3 participants