Optimized version

Recommend this page to a friend!

      Animated GIF into images  >  All threads  >  Optimized version  >  (Un) Subscribe thread alerts  
Subject:Optimized version
Summary:An optimized version for the GIFDecoder class
Author:Olivier Bourdoux
Date:2014-10-26 16:00:28


  1. Optimized version   Reply   Report abuse  
Picture of Olivier Bourdoux Olivier Bourdoux - 2014-10-26 16:00:28
I made an optimized version of the GIFDecoder class, I think it is worth sharing.

It avoid GIFGetByte/GIFPutByte for the images content. Instead, it is copied directly to the returned images. This eliminates a lot of ord() and chr() calls, which leads to about x4 speed improvement for large images.

Some other improvements :
- it uses the SplFixedArray to improve the performances of GIFGetByte, so it requires PHP >=5.3.
- it allows you to extrct the dimensions and position of each frame, if you want to rebuild your animation after some modifications.

You can find it here : https://github.com/xurei/GIFDecoder_optimized

  2. Re: Optimized version   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2015-02-22 09:19:10 - In reply to message 1 from Olivier Bourdoux
Hi Olivier!

Thank you very much!:)
I save your link!

I am so sorry, but i have not enought time to develop my classes.

For more information send a message to info at phpclasses dot org.