-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
Fix for Windows 2.0 or OS/2 1.x bitmaps only use 3 bytes per color palette entry #792
Fix for Windows 2.0 or OS/2 1.x bitmaps only use 3 bytes per color palette entry #792
Conversation
Codecov Report
@@ Coverage Diff @@
## master #792 +/- ##
=========================================
+ Coverage 88.7% 88.7% +<.01%
=========================================
Files 1012 1012
Lines 43248 43253 +5
Branches 3127 3127
=========================================
+ Hits 38363 38369 +6
+ Misses 4181 4180 -1
Partials 704 704
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #792 +/- ##
========================================
Coverage ? 88.7%
========================================
Files ? 1012
Lines ? 43253
Branches ? 3127
========================================
Hits ? 38369
Misses ? 4180
Partials ? 704
Continue to review full report at Codecov.
|
@JimBobSquarePants: maybe you can help me here, i think i am missing something obvious. I wanted to create a unit test which verifies the Decoded bitmap with reference bitmap, which was added yesterday.
I think i need to use CompareToReferenceOutput from the TestImageExtension, but i am unsure howto do it correctly. Can you point me to an example where i can see how i should use it. |
@brianpopow No worries. When comparing a decoder we save the output (defaults to 32bit png) so we can view it manually then we call the
That reference you added yesterday would be useful only when testing encoding once we can encode that bitmap type. You would normally just add the image to the input folder for testing the decoder. |
…4 bytes per color palette
@JimBobSquarePants thank you for the clarification! The image i have added to the submodul was a bitmap with 40 bytes header which imagesharp can already decode. I wanted to use that as a reference. Saving the image as png and then comparing to System.Drawing makes much more sense, then the stunt i wanted to do :-) . So the image i have added to the submodul can be safely deleted. Sorry for this misunderstanding. I have added now two tests. One for decoding a windows BMPv2 and to make sure decoding images with a palette of 4 bytes per entry still works, another one for that case. |
unfortunately that does not work either. System.Drawing can not decode this bitmap. edit: works on windows, but not on ubuntu. |
Merged. Thanks so much for your help with bitmaps. I don't understand the various specs well enough just now and you've really made a positive difference to the library. 👍 |
@JimBobSquarePants: thank you! I am happy, that i could help a bit. |
…letteFix WIP: Fix for Windows 2.0 or OS/2 1.x bitmaps only use 3 bytes per color palette entry
Prerequisites
Description
The following bitmap is not decoded correctly:
pal8os2.zip
The output is:
The expected output is:
Windows 2.0 or OS/2 1.x bitmaps use 3 bytes per color palette instead of 4, as described here:
http://www.fileformat.info/format/bmp/egff.htm
This PR provides a fix for that.