Closed deepak-trimantra closed 6 years ago
I am having same issue but it shows 502 Bad Gateway
In create passing third parameter solved my issue e.g. $anim->create( "img/", array( 100 ), 1)->save( "anim.gif" );
Same problem here, using PHP 7. Displaying the animated GIF in browser results in 'cannot be displayed because it contains errors'.
header("Content-type: image/$ext"); //$ext is 'png or gif'
if ($ext === 'png') { ... }
else if ($ext === 'gif') {
$frames = $imagesArray; //array of images, created with 'imagecreatedfromgif'
$durations = array(); //duration array for 10 secs in 1/100ms
for ($i = 0; $i < $imagesCount; $i++) { //$imagesCount is $imagesArray length
array_push($durations, 1000);
}
$anim = new \GifCreator\AnimGif();
$anim->create($frames, $durations, 0);
$gif = $anim->get();
echo $gif;
exit;
}
Previously runnig PHP 5.6 was running fine. Only change then was adding the backslash before GifCreator in PHP 7.
Anyone a suggestion? I am now using PHP 7.0.13 and still the same error message displaying. Looked through the code with NetBeans and PHP 7 info markup and no errors found. But it started to happen right after the code update on 7th March.
Hello,
I tried this library. This one creates a animated gif if i use save(); but i want to display gif in browser
but this do not show gif in the browser, if i open it in firefox browser it shows 'cannot be displayed because it contains errors'.