[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] GIF image size



Hello,

The dimensions of a GIF image are located at bytes 6-9 of the file (right
after the signature-version bytes "GIFXXx"). You can get them with
something like this:

###
open (F, "SomeImage.gif")
   or die "Uh oh: $!\n";

seek (F, 6, 0);
read (F, $width, 2);
read (F, $height, 2);

close F;

$width  = unpack ("v", $width);
$height = unpack ("v", $height);
###

Sorry, I can't find the URL for the GIF format spec. I know I have it
somewhere.

HTH,

Andre

============================

>Maybe this is more of a graphic file format size than a MacPerl one, but...
>
>Is there a way for MacPerl to read a GIF file, and figure out the size (in
>pixels) of the graphics?
>
>
>___Carl_Johan_Berglund_________________________
>   Adverb Information
>   carl.johan.berglund@adverb.se
>   http://www.adverb.se/
>
>
>
>***** Want to unsubscribe from this list?
>***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch


--
AndrŽ Leclerc
alecler@cam.org



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch