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?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.