On Mon, Jun 8, 2009 at 13:11, Ron de Bruijn<r...@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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to