-
Notifications
You must be signed in to change notification settings - Fork 121
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
BMP write bug fix #2101 #2289
BMP write bug fix #2101 #2289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! I have a small nit to pick, but otherwise, I think this is correct. I am not sure if our CI exercises this routine, though.
fwrite_wrapper("\x20\0", 2, 1, bmp); | ||
// x03 indicates compression method as BI_BITFIELDS | ||
fwrite_wrapper("\x03\0\0\0", 4, 1, bmp); | ||
fwrite_wrapper("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20, 1, bmp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can you use constexpr char k48Zeros[48] = {};
for these buffers, instead of the arbitrarily-long string literals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will update that.
I've made the changes. |
Codecov Report
@@ Coverage Diff @@
## master #2289 +/- ##
==========================================
+ Coverage 35.25% 35.27% +0.02%
==========================================
Files 213 213
Lines 20460 20474 +14
==========================================
+ Hits 7213 7223 +10
- Misses 13247 13251 +4
Continue to review full report at Codecov.
|
Hi, this is the fix which updates the bmp header present in
image_save_bmp(...)
method ofimage_formats.cpp
from 40 byteBITMAPINFOHEADER
to 108 byteBITMAPV4HEADER
to support transparency.Reference used for fix: BMP_Wiki.