Skip to content

Commit 76197ca

Browse files
authored
Corrected typo in GIF header generation, fixes #2
Also corrected is the loop value which should be zero based.
1 parent 0b388f5 commit 76197ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GifCreator/AnimGif.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ protected function gifAddHeader()
302302
$this->gif .= substr($this->frameSources[0], 6, 7);
303303
$this->gif .= substr($this->frameSources[0], 13, $cmap);
304304
if ($this->loop !== 1) // Only add the looping extension if really looping
305-
$this->gif .= "!\xFF\x0BNETSCAPE2.0\0x03\0x01".word2bin($this->loop)."\x0";
305+
$this->gif .= "!\xFF\x0BNETSCAPE2.0\x03\x01".word2bin($this->loop==0?0:$this->loop-1)."\x0";
306306
}
307307
}
308308

0 commit comments

Comments
 (0)