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

AnyBitmap.FromFile() on a 24bpp file will return a bitmap with the wrong encoding. #66

Open
chipego-ironsoftware opened this issue Jun 30, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@chipego-ironsoftware
Copy link

Description

When using the AnyBitmap.FromFile() method on a 24bpp file, the returned bitmap has the correct properties BitsPerPixel=24 and Stride=2564 (approximately width * 3). However, upon inspecting the Scan0 data, it appears to contain unexpected alpha data in the pattern of X Y Z 255 X Y Z 255 which is 32bpp with an alpha channel.

To Reproduce

  • Use the AnyBitmap.FromFile() method to load a 24bpp file.
  • Inspect the properties of the returned bitmap, specifically BitsPerPixel and Stride.
  • Examine the Scan0 data of the bitmap.

Workaround

public static AnyBitmap BitmapFromFile(string path)
  {
   AnyBitmap img = AnyBitmap.FromFile(path);
   return new AnyBitmap(img, img.Width, img.Height);
  }

Test Image

This is a 24bpp image provided for the purpose of reproduction.
TestLutBurnt

@chipego-ironsoftware chipego-ironsoftware changed the title AnyBitmap.FromFile() on a 24bpp file will return a bitmap with the encoding. AnyBitmap.FromFile() on a 24bpp file will return a bitmap with the wrong encoding. Jul 3, 2023
@michael-ironsoftware michael-ironsoftware added the bug Something isn't working label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants