Getting the width and height of an GIF ?

Getting the width and height of an GIF ?

Post by micha.. » Tue, 25 Jun 1996 04:00:00



Hi,

I'm sure if this is the correct place to post this question. What I am trying
to do is get the width and height of a GIF image which I currently have as
array of bytes. What I would like to know is what bytes represent the width
and the height ? ie. byte n = width

Thanks

Michael Fieldhouse

 
 
 

Getting the width and height of an GIF ?

Post by cWe » Tue, 02 Jul 1996 04:00:00



>Hi,

>I'm sure if this is the correct place to post this question. What I am trying
>to do is get the width and height of a GIF image which I currently have as
>array of bytes. What I would like to know is what bytes represent the width
>and the height ? ie. byte n = width

>Thanks

>Michael Fieldhouse


Hi!

In most cases the size of the GIF is as follows:

Width   = byte 6 and 7
Height  = byte 8 and 9

or something like this...

BYTE Array[n];  // Containing the GIF file.

int width    = *(WORD*)&Array[6];
int height  = *(WORD*)&Array[8];

That is if its only 1 image in the GIF file.

If you want more specific information about the GIF format
dont hesitate to mail me...