Jump to content

thumbnail script errors - expert help needed


pouncer

Recommended Posts

http://www.interzurf.com/socialnetwork/collection_items/John_images/godfather1.jpg

 

that displays the image, now when i try to display a thumbnail:

 

http://www.interzurf.com/socialnetwork/thumbnail.php?im=collection_items/John_images/godfather1.jpg

 

you can see the errors, here's the thumbnail script

 

<?php
// e.g; thumbnail.php?im=path/imagename.jpg

Header("Content-type: image/jpeg");

// The $orig_image returns an image identifier representing the image obtained from the given filename. 
$orig_image = imagecreatefromjpeg($im);

// Get the size of the image and store it in the list array variables.
// getimagesize() returns an array with these elements; width/height/image type/attirbutes
list($width, $height, $type, $attr) = getimagesize($im); 

// Apply the shrink calculation.
$Numb = 100;

// Adjust the height if the current images width is more than 100.
if ($width > $Numb) {  
	$newheight = ($Numb / $width) * $height; 
} 
else $newheight = $height; 

// Create a new true color image based on the above sizes.
$blank_image = imagecreatetruecolor($Numb, $newheight);

// Copy and resize the old image with resampling
imagecopyresampled($blank_image, $orig_image, 0,0,0,0, $Numb, $newheight, imagesx($orig_image), imagesy($orig_image)); 

// Create a new JPG image and output it to the browser.
imagejpeg($blank_image); 

// Destroy the variables as we don't need them after the image has been outputten.
imagedestroy($blank_image);
imagedestroy($orig_image); 
?>

 

Can someone please help me out?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.