Closed GoogleCodeExporter closed 8 years ago
I see the problem with negative height, it seems easy to fix. Do you know where
we can find such BMP file to test?
Can you provide some details about the other problems you refer ? ("issues
common in Mac image editors (...) they rarely set the image size value
correctly")
Original comment by yrizoud
on 17 May 2011 at 10:02
There are some test images here:
http://ant.simianzombie.com/testbmps/
They have all been created using Acorn v2 in OSX.
Regarding the other issues, if you open one of those files up in a hex editor
you'll notice that the value for image size (called Size_3 in your BMP header)
is 0. It should be equal to the size of the file minus the size of the header,
and represents the total amount of non-header data in the image (note that it's
not the same as width * height * bits per pixel, as the image will undoubtedly
include extra padding between rows and at the end of the file). However, none
of the editors I have here - Pixen, Acorn, Paintbrush - set the value
correctly. They all leave it as 0, which makes me think that they're using an
official BMP API from Apple that is mangling the header data.
Original comment by antdze...@gmail.com
on 17 May 2011 at 10:30
Thanks, samples help a lot.
About "Size3", I just found a source that says about it: "If there is no
compression, it is valid to set this member to zero."
(http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html)
It seems that each time I have to look up some details on BMP format, I find
contradicting information. Grafx2 will actually ignore this value, even for
compressed bitmaps. And Grafx2 itself has always saved a zero for this field.
--'
Original comment by yrizoud
on 17 May 2011 at 11:55
No prob. Thanks for clarifying the Size3 field.
You're right about the amount of contradictory information around the BMP spec.
The only reason I spotted this bug in the first place is because I'm fixing
the same problem in my own Python BMP loader...
Original comment by antdze...@gmail.com
on 17 May 2011 at 12:00
I think this was fixed in a recent changeset. Can anyone confirm ? :)
Original comment by pulkoma...@gmail.com
on 19 Jun 2011 at 8:38
Fixed in r1787 (release branch) for 2.3, and merged to trunk for 2.4wip.
Original comment by yrizoud
on 20 Jun 2011 at 10:32
Original issue reported on code.google.com by
antdze...@gmail.com
on 17 May 2011 at 8:51