public function postProcessCreateAnimatedGif(array $output) { // create the gif $gif = AnimatedGif::createFrom($output, 1 / $this->_format['video_frame_rate'], $this->_format['gif_loop_count'], $this->_config); // break out the dirname incase of relative pathways. $name = basename($this->_original_save_path); $path = realpath(dirname($this->_original_save_path)); $save_path = $path . DIRECTORY_SEPARATOR . $name; // save the gif $image = $gif->save($save_path); // remove tmp frame files foreach ($output as $output_image) { @unlink($output_image->getMediaPath()); } // return an updated output return $image; }
public function postProcessCreateAnimatedGif(array $output, Media $media, $save_path, $overwrite, $video_frame_rate, $gif_loop_count, $gif_frame_delay) { // create the gif $gif = AnimatedGif::createFrom($output, 1 / $video_frame_rate, $gif_loop_count, $this->_config); // break out the dirname incase of relative pathways. $name = basename($save_path); $path = realpath(dirname($save_path)); $save_path = $path . DIRECTORY_SEPARATOR . $name; // save the gif $image = $gif->setFrameDelay($gif_frame_delay)->setOverwriteMode($overwrite)->save($save_path, $overwrite); // remove tmp frame files foreach ($output as $output_image) { @unlink($output_image->getMediaPath()); } // return an updated output return $image; }