[VPM] Correct List?
Peter Scott
Peter at PSDT.com
Sat Jun 28 10:09:53 CDT 2003
I don't have any experience with PNG formats. Anyone on the list got any
help for Timothy?
At 06:20 PM 6/27/2003 -0700, Timothy wrote:
>Now a Perl question. I am attempting to read PNG files with Perl. Most
>of it is fairly basic. However I am having a heck of a time figuring
>out how the IDAT chunk works. I've read in the appropriate chunk from the
>file as $strData.
>
> $strData = uncompress($strData); # <-- from Zlib
> @PNGIDAT = unpack("C" x length($strData), $strData);
>
>So far so good. Now this is a 3x3 image true color, non-interlaced and
>a bit depth of 8. The image is simply plain white. However when I print
>the RGB values I don't get all 255s I get this:
>
> 1 255 255 255 0 0 0 0 0 0
> 255 0 0 0 0 0 0 2 0 0
> 0 0 0 0 2 0 0 0 0 0
>
>I guess I'm not unpacking them correctly? The rest other chunks I had
>no problems with. Any insight? TIA:)
--
Peter Scott
peter at psdt.com
http://www.perldebugged.com
More information about the Victoria-pm
mailing list