-
-
Notifications
You must be signed in to change notification settings - Fork 855
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
ImageSharp "Does not support this kind of bitmap files" #735
Comments
Yeah, bitmap support covers the more common types so far. @dlemstra Is there code we can use as inspiration from ImageMagick? |
I think we should be able to add support for this. And the file |
That's good news! 🎉 |
If we update the support listed in #320 we can fix this |
@wc-matteo: would you mind sharing the image here again? The drop box link does not work anymore. Just attaching it to this ticket would be helpful to reproduce it. |
@brianpopow fixed the link. Don't know what happened there. |
* decoding bitmaps with Bitfields masks * added testcases for Bitfields bitmaps * added parsing of the complete bitmap V4 header to get the color masks infos for the BITFIELDS compression * writing now explicitly a Bitamp v3 header (40 bytes) * added test image for issue #735 * fixed rescaling 5-bit / 6-bit to 0 - 255 range * BitmapEncoder now writes BMP v4 header * using MemoryMarshal.Cast to simplify parsing v4 header * added testcases for bitmap v3, v4, v5 * Bitmap encoder writes again V3 header instead of V4. Additional fields for V4 are zero anyway. * added parsing of special case for 56 bytes headers * using the alpha mask in ReadRgb32BitFields() when its present * added support for bitmasks greater then 8 bits per channel * using MagickReferenceDecoder reference decoder for the test with 10 bits pixel masks * changed bitmap constants to hex * added enum for the bitmap info header type * added support for 52 bytes header (same as 56 bytes without the alpha mask) * clarified comment with difference between imagesharp and magick decoder for Rgba321010102 * BmpEncoder now writes a V4 info header and uses BITFIELDS compression * workaround for issue that the decoder does not decode the alpha channel correctly: For V3 bitmaps, the alpha channel will be ignored during encoding * Fix #732
* decoding bitmaps with Bitfields masks * added testcases for Bitfields bitmaps * added parsing of the complete bitmap V4 header to get the color masks infos for the BITFIELDS compression * writing now explicitly a Bitamp v3 header (40 bytes) * added test image for issue SixLabors#735 * fixed rescaling 5-bit / 6-bit to 0 - 255 range * BitmapEncoder now writes BMP v4 header * using MemoryMarshal.Cast to simplify parsing v4 header * added testcases for bitmap v3, v4, v5 * Bitmap encoder writes again V3 header instead of V4. Additional fields for V4 are zero anyway. * added parsing of special case for 56 bytes headers * using the alpha mask in ReadRgb32BitFields() when its present * added support for bitmasks greater then 8 bits per channel * using MagickReferenceDecoder reference decoder for the test with 10 bits pixel masks * changed bitmap constants to hex * added enum for the bitmap info header type * added support for 52 bytes header (same as 56 bytes without the alpha mask) * clarified comment with difference between imagesharp and magick decoder for Rgba321010102 * BmpEncoder now writes a V4 info header and uses BITFIELDS compression * workaround for issue that the decoder does not decode the alpha channel correctly: For V3 bitmaps, the alpha channel will be ignored during encoding * Fix SixLabors#732
Prerequisites
DEBUG
andRELEASE
modeDescription
Trying to open a specific bitmap file created with
Magick.NET
fails with an exception. Other files created in the same way don't.Selecting
ImageMagick.MagickFormat.Bmp2
orImageMagick.MagickFormat.Bmp3
resolves the issue. The issue is withImageMagick.MagickFormat.Bmp
specifically, which uses, according to the docs, version 4 of the format.The image in question does open without issues in other Windows programs (Paint, Photos, Photoshop) and Dropbox.
Steps to Reproduce
Download the file.
Try to open it:
generates
System Configuration
The text was updated successfully, but these errors were encountered: