Re[2]: [PHP] Better way to store data in memory?
| From: | Richard Davey | Date: | Wed, 25 Jul 2007 08:28:04 +0000 |
| Subject: | Re[2]: [PHP] Better way to store data in memory? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-259496@lists.php.net to get a copy of this message | ||
Hi Richard,
Wednesday, July 25, 2007, 5:20:32 AM, you wrote:
> It's possible, maybe, that using imagecolorat and imagesetcolor (or
> whatever it is) would be faster than array access...
In the end I implemented RLE on the image data, and depending on the
image in question it is saving sometimes up to 70%, which I'm quite
happy with. I also found a neat way to avoid using a temporary
location, dropping my requirement for the massive array entirely.
> It would be Really Nifty if the GD library provided functions to
> convert a pixel column to an array and vice versa, eh?
Certainly, but I won't hold my breath. You can *almost* get a similar
result to this by holding the image data in a string and grabbing
chunks from it that way (GDs imagestring() function being a god-send
here)
Cheers,
Rich
--
Zend Certified Engineer
http://www.corephp.co.uk
"Never trust a computer you can't throw out of a window"