$ ghci GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help Prelude> import Codec.Picture Prelude Codec.Picture> Right pic <- readImage "smiley.bmp" <interactive>: out of memory (requested 4296015872 bytes)
smiley.bmp
is under 300 bytes. Why did I run out of memory?
This is a bug in juicypixels where bitmaps with negative heights aren't interpreted properly.
The negative height should denote the origin is in the top left rather than bottom left corner.
I have opened a new bug report here: https://github.com/Twinside/Juicy.Pixels/issues/105
Juicy pixels does not support bitmap particularly well. There are a number of other limitations. (see https://github.com/Twinside/Juicy.Pixels/issues/96)
This is not really a valid bitmap file and JuicyPixels is not error checking the inputs like it should. Notice the dimensions...
% file smiley.bmp
smiley.bmp: PC bitmap, Windows 3.x format, 8 x -8 x 24
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With