You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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
Workaround
Test Image
This is a 24bpp image provided for the purpose of reproduction.
![TestLutBurnt](https://private-user-images.githubusercontent.com/132034006/250039058-070ed51d-d73f-4b44-a422-810c5ce2f1f5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MzE1NDAsIm5iZiI6MTczOTUzMTI0MCwicGF0aCI6Ii8xMzIwMzQwMDYvMjUwMDM5MDU4LTA3MGVkNTFkLWQ3M2YtNGI0NC1hNDIyLTgxMGM1Y2UyZjFmNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQxMTA3MjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wNmM5NzIzY2M2NjQ4NDY5MjU4MGFkMDE1MGJkNTFkYzA1N2MzZmExMzg4NTMyN2FmY2NmYTI4OTE4MGZhMTcwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.48TwNZKpy3MHVqRLugR4t7M6F6-sDh2AH2aRHg4f4x0)
The text was updated successfully, but these errors were encountered: