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
{{ message }}
Repository navigation
bmp written is not supported by Chrome or Firefox #886
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
When saving image as bmp it can not be seen with Chrome or Firefox, however it can be read by MS Paint.
This started to happen with 1.0.0-beta0006 when i compare the produced image with one from 1.0.0-beta0005 i can see that the bmp header is different....
Environment (Operating system, version and so on):
.NET Framework version:
Additional information:
Reactions are currently unavailable
Activity
ghost changed the title [-]bmp written is not suppprted by Chrome or Firefox[/-][+]bmp written is not suppported by Chrome or Firefox[/+]on Apr 16, 2019
ghost changed the title [-]bmp written is not suppported by Chrome or Firefox[/-][+]bmp written is not supported by Chrome or Firefox[/+]on Apr 16, 2019
we have indeed changed the bitmap header in beta0006 to V4 to support bitmaps with transparency. As @JimBobSquarePants said, chrome and firefox should support those.
I checked the imagesharp bitmap encoder and at first glance i can not spot an error.
I was thinking maybe we should write V3 bitmap header as default and keep writing V4 headers as optional. I will look further into this the next days.
The v4 header does not seem to be the issue here. It seems to be combination of V4 header + 24 bits per pixel + Bitfields compression which chrome and firefox does not like. Bitfields with 32 bits per pixel does work with chrome, firefox and irfanview.
@pammann-work: as i said in my first post. The intention for using V4 header (with Bitfields) was to support transparency, but in your case with 24 bpp, there is no transparency anyway. Your hack for changing from bitfields (0x03) to no compression (0x00) works, because we use 8 bit per color channel with bitfields. This is essentially the same as uncompressed (without transparency).
I wanted to change the bitmap header to default to V3, which implies no compression. V3 headers should be supported by almost all decoders.
Activity
[-]bmp written is not suppprted by Chrome or Firefox[/-][+]bmp written is not suppported by Chrome or Firefox[/+][-]bmp written is not suppported by Chrome or Firefox[/-][+]bmp written is not supported by Chrome or Firefox[/+]JimBobSquarePants commentedon Apr 17, 2019
Odd. V4 bitmaps should be supported. @brianpopow do you have any insight here?
http://entropymine.com/jason/bmpsuite/bmpsuite/html/bmpsuite.html
brianpopow commentedon Apr 17, 2019
we have indeed changed the bitmap header in beta0006 to V4 to support bitmaps with transparency. As @JimBobSquarePants said, chrome and firefox should support those.
I checked the imagesharp bitmap encoder and at first glance i can not spot an error.
I was thinking maybe we should write V3 bitmap header as default and keep writing V4 headers as optional. I will look further into this the next days.
JimBobSquarePants commentedon Apr 18, 2019
Thanks @brianpopow appreciate it! That sounds like a sensible plan.
brianpopow commentedon Apr 18, 2019
The v4 header does not seem to be the issue here. It seems to be combination of
V4 header + 24 bits per pixel + Bitfields compressionwhich chrome and firefox does not like. Bitfields with 32 bits per pixel does work with chrome, firefox and irfanview.@pammann-work: as i said in my first post. The intention for using V4 header (with Bitfields) was to support transparency, but in your case with 24 bpp, there is no transparency anyway. Your hack for changing from bitfields (0x03) to no compression (0x00) works, because we use 8 bit per color channel with bitfields. This is essentially the same as uncompressed (without transparency).
I wanted to change the bitmap header to default to V3, which implies no compression. V3 headers should be supported by almost all decoders.
JimBobSquarePants commentedon May 1, 2019
Fixed with #889