Juicy Pixels 抱怨内存不足

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 <- readImage "smiley.bmp"
<interactive>: out of memory (requested 4296015872 bytes)

smiley.bmp 小于 300 字节。为什么我 运行 内存不足?

这不是真正有效的位图文件,JuicyPixels 没有像它应该的那样检查输入错误。注意尺寸...

% file smiley.bmp
smiley.bmp: PC bitmap, Windows 3.x format, 8 x -8 x 24

这是 juicypixels 中的一个错误,其中负高度的位图无法正确解释。

负高度应该表示原点在左上角而不是左下角。

我在这里打开了一个新的错误报告:https://github.com/Twinside/Juicy.Pixels/issues/105

Juicy pixels 对位图的支持不是特别好。还有许多其他限制。 (参见 https://github.com/Twinside/Juicy.Pixels/issues/96