GIF Control Blocks / Types in perl - unsigned, etc. 
Author Message
 GIF Control Blocks / Types in perl - unsigned, etc.

Quote:

>This is related to a question I posted earlier, regarding pack()
>templates.

>I am calling pack() to create a GIF Control Block for use in me-created
>animated GIFs. Everything is working well except the delay time - the GIF
>specs call for an unsigned value, which represents the number of
>hundredths of a second to wait before displaying the next image.

>I pass an "S" to pack(), i.e.:

>$controlblock = pack("CCCCSCC",0x21,0xF9,0x04,0x00,255,0x00,0x00)

>The "255" is the value I'm packing into the "S".

I'm at the moment also into gif mixing.
First of all note where the Graphic Control Block is placed between other
blocks. Secondly take care this block is at the right offset.
(previous color table is correct size, and so on)
And this is what anyhow works (just like you did only a little more
readable) ;

# Graphic Control Extension block
$graphCtrE = chr(33) ;
$byte2     = chr(249) ;
$byte3     = chr(04) ;
$graphCtrE = $graphCtrE . $byte2 . $byte3 ;
$packet3   = pack("B8", "00000000") ;
$delaytime = pack("S", 00) ;
$transpar  = chr(00) ;
$end       = chr(00) ;
$graphCtrE = $graphCtrE .  $packet3 . $delaytime . $transpar . $end ;

Hope it helps,

Mathilde muPe



Sat, 25 Dec 1999 03:00:00 GMT  
 GIF Control Blocks / Types in perl - unsigned, etc.

Quote:

> I'm at the moment also into gif mixing.
> First of all note where the Graphic Control Block is placed between
> other
> blocks. Secondly take care this block is at the right offset.
> (previous color table is correct size, and so on)
> And this is what anyhow works (just like you did only a little more
> readable) ;

> # Graphic Control Extension block
> $graphCtrE = chr(33) ;
> $byte2     = chr(249) ;
> $byte3     = chr(04) ;
> $graphCtrE = $graphCtrE . $byte2 . $byte3 ;
> $packet3   = pack("B8", "00000000") ;
> $delaytime = pack("S", 00) ;
> $transpar  = chr(00) ;
> $end       = chr(00) ;
> $graphCtrE = $graphCtrE .  $packet3 . $delaytime . $transpar . $end ;

> Hope it helps,

> Mathilde muPe

Actually, you're all too right - your code does EXACTLY the same thing
mine does, introduce a delay which is too long. I changed your

$delaytime = pack("S", 00);

to

$delaytime = pack("S", 50);

and used your code. My delay still comes across as 256 * 50, or 12800
hundredths of a second.

Could this be some sort of bug? Except for the delay time fields in my
control blocks, everything is EXACTLY as it should be...

I'm running straight 5.000:

% perl -v
This is perl, version 5.000

Thanks,

Josh Kortbein



Sat, 25 Dec 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Unsigned Char to Unsigned long

2. Verifying that it's an image (.jpg, .gif , etc)

3. Announce: pixmaped-1.00 xpm/gif icon editor + etc

4. lwall.gif tchrist.gif merlyn.gif

5. JPEG and GIF MIME type decoding

6. Content-Type: image/gif ..

7. Header types for HTML plus GIF

8. ******** Automatic Version Control System (I/A's etc) ********

9. ******** Automatic Version Control System (I/A's etc) ********

10. question about blocking sockets on high latency satellite networks, etc

11. ******** Automatic Version Control System (I/A's etc) ********

12. ******** Automatic Version Control System (I/A's etc) ********

 

 
Powered by phpBB® Forum Software