Voting

: min(five, three)?
(Example: nine)

The Note You're Voting On

Blizzke at gmail dot com
17 years ago
I use dynamically generated images that require a little touch-up before being displayed. So essentially I do some base work, then store the images in a memory cache (APC), reload the images again from the cache later on "into" GD, do final processing and then display the image.
Since I wanted to avoid a lot of disc access I used the output buffering functions:

<?php
// Do your image processing stuff

// Start buffering
ob_start ( );
ImageGD ( $hImage );
$sImage = ob_get_contents ( );
ob_end_clean ( );

// Put stuff into cache

// Reload from cache and recreate image
$hImage = imagecreatefromstring ( $sImage );

// Do final editing stuff and output image
?>

Of course this is a condensed example but I just wanted to share the idea.

<< Back to user notes page

To Top