Michael Hulet - 2005-02-17 13:38:45
Hi,
I'm using PThumb, wich is the only one I found not requering ImageMagick and using nice caching functions.
I got a problem, as first load of a thumbnail gives picture as data (hundreds of lines of characters). After reloading page, no problem: thumbnail generated.
I use default options and make the call as this:
[code]
<?php
include_once('class/PThumb.class.php');
// setup des options de génération des miniatures
class thumb extends PThumb
{
function thumb()
{
$this -> PThumb();
$this -> use_cache = true;
$this -> cache_dir = "cache/";
$this -> error_mode = 1;
}
}
$thumbnail = new thumb;
// thumbnail
$thumbnail_location = $thumbnail->fit_thumbnail('photo.jpg', 150, -1);
list($width, $height, $type, $attr) = getimagesize($thumbnail_location);
?>
<img src="<?php echo $thumbnail_location ?>" alt="" />
[/code]
Please can someone help me finding what's going wrong?