[Haskell-cafe] Hsmagick crash

Thomas ten Cate ttencate at gmail.com
Mon Jun 8 07:43:01 EDT 2009


On Mon, Jun 8, 2009 at 13:11, Ron de Bruijn<ron at gamr7.com> wrote:
> Mark Wassell schreef:
>> Have you tried
>> http://hackage.haskell.org/cgi-bin/hackage-scripts/package/pngload ?
> Hi Mark,
>
> I just did:
>
> import Codec.Image.PNG
>
> png_file_to_2d_array file = do
>  either_error_string_or_png <- loadPNGFile file
>  either
>    (\s -> error $ "(png_file_to_2d_array) " ++ s)
>    (\png ->
>      putStrLn (show (dimensions png))
>      )
>    either_error_string_or_png
>
> and then calling it gives:
>
> *** Exception: (png_file_to_2d_array) failed to parse chunk "IHDR", (line 1,
> column 1):
> unexpected 0x0
> expecting valid colorType: supported Ct2,Ct6

Testing this code with the PNG file from [1] gives me

(png_file_to_2d_array) "PNG_transparency_demonstration_2.png" (line 1,
column 1):
unexpected 0x2d

I guess that proves that it's not just you, but not much else.

Thomas

[1] http://upload.wikimedia.org/wikipedia/commons/9/9a/PNG_transparency_demonstration_2.png


More information about the Haskell-Cafe mailing list