Open khstar2000 opened 6 years ago
Upd: This is the best solution, which i have found:
<?php
function FrameCount($File){
if(is_file($File)) $File = file_get_contents($File);
return abs(substr_count($File, "\x21\xf9")-substr_count($File,"\x21\xfe")-2);
}
i nedd frame count in render and decorder. see in following code $gifStream = new FileStream($target_file); $gifDecoder = new Decoder($gifStream); $gifRenderer = new Renderer($gifDecoder); $gifRenderer->start(function (FrameRenderedEvent $event) { imagepng($event->renderedFrame, DIR . "/../gif_render/frame{$event->frameIndex}.png"); }); and how to change png filepath and filename(here is gif_render/frame ....png). then create png, how know png count?