[Haskell-cafe] Data.Bitmap, readBitmap exception

Alexander Foremny alexanderforemny at gmail.com
Thu Jun 28 17:47:03 CEST 2012


I tested a similar GHCi session as the ones above with a Bitmap file I
found in the wild and I encountered the same results for Bitmap Word8,
Bitmap Word16 and other exceptions for Bitmap Word32, Bitmap Float.

> readBitmap "chef.bmp" :: IO (Bitmap Word32)
> *** Exception: mallocForeignPtrBytes: size must be >= 0

However, there is still the possibility that this Bitmap might be
corrupted either. Just thought I'd report this.

Regards,
Alexander Foremny

2012/6/28 Alexander Foremny <alexanderforemny at gmail.com>:
> For what it's worth I created that Bitmap file with Gimp and exported
> to 32 bit R G B A bitmap. I'll try another bitmap file later and
> report back.
>
> 2012/6/28 Krzysztof Skrzętnicki <gtener at gmail.com>:
>> That bitmap must be pretty weird. 'file' command reports 'data', so headers
>> must be off. Image viewer OTOH does handle the file.
>>
>> Best regards,
>> Krzysztof Skrzętnicki
>>
>> On Thu, Jun 28, 2012 at 2:03 PM, Brandon Allbery <allbery.b at gmail.com>
>> wrote:
>>>
>>> On Thu, Jun 28, 2012 at 7:34 AM, Alexander Foremny
>>> <alexanderforemny at gmail.com> wrote:
>>>>
>>>> I am using bitmap-0.2 [1] to load a Bitmap file [2]. However, the
>>>> following sample GHCi session fails for me.
>>>
>>>
>>> For what it's worth, my system doesn't recognize your bitmap as a valid
>>> image file.
>>>
>>> --
>>> brandon s allbery                                      allbery.b at gmail.com
>>> wandering unix systems administrator (available)     (412) 475-9364 vm/sms
>>>
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe at haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>



More information about the Haskell-Cafe mailing list