Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Juicy Pixels complains about not having enough memory

$ ghci
GHCi, version 7.10.1: http://www.haskell.org/ghc/  :? for help
Prelude> import Codec.Picture
Prelude Codec.Picture> Right pic &lt- readImage "smiley.bmp"
&ltinteractive>: out of memory (requested 4296015872 bytes)

smiley.bmp is under 300 bytes. Why did I run out of memory?

like image 574
PyRulez Avatar asked Aug 22 '15 19:08

PyRulez


2 Answers

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)

like image 196
Alex Avatar answered Sep 25 '22 20:09

Alex


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
like image 39
Thomas M. DuBuisson Avatar answered Sep 23 '22 20:09

Thomas M. DuBuisson