Re: Image resize problems



Here is the code that I get the error with

<?php
// File and new size
$filename = 'test.jpg';
$percent = 0.5;

// Content type
header('Content-type: image/jpeg');

// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = $width * $percent;
$newheight = $height * $percent;

// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);

// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight,
$width, $height);

// Output
imagejpeg($thumb);
?>

And this is the error I get
<br />
<b>Fatal error</b>: Call to undefined function:
imagecreatetruecolor() in
<b>/tmp/disk/home/webmaster/Files/WWW/image_test.php</b> on line
<b>15</b><br />

Thanks



ctclibby wrote:
Well now, how about at lease *some* snippets of the image mashing
script so we can have *some* sort of idea of what you are trying to do?

wondering minds want to know.
mikeyatsony wrote:
Hi all..
I've been testing scripts that I found online but it dies at the
imagecreatetruecolor function. And most of the examples show that.

Here is the GD info from phpinfo()
gd
GD Support enabled
GD Version 1.6.2 or higher
JPG Support enabled
PNG Support enabled
WBMP Support enabled

I just want to resize a JPEG image to create a thumbnail. Any
suggestions?

Thanks

.