View Single Post
Old 12-13-2005, 11:23 PM   #1 (permalink)
Murdoc
 
True Techie

Join Date: Apr 2005

Posts: 110

Murdoc

Default generating thumbnails (PHP)

Hello everyone,

I'm trying to make a script that will generate thumbnails. I've suceeded about half way and failed. Why? The problem is because I can't save properly.

I want the thumbnail to be generated and then SAVED as a new version of jpg.

IE:
1) p01.jpg <- original file

becomes

2) p01th.jpg <- resized file

When I try to save I used this command

ImageJpeg ($final_image, "p01th.jpg",100);

it generates the file perfectly and saves just like I wanted it to, but then generates an error as well saying:

Cannot display picture from ../../../thumbnails/makethumbnails.php because it contains errors.

This means it must have tried to output the image to the browser, but the thing is I don't want it to output to browser. All I want it to say is "Finished generating thumbnails." and save all the generated thumbnails as .jpg files and that's it. Does anyone know why this happens? When I take away the "p01th.jpg" part, I am able to see the new thumbnail on browser but it doens't get saved = / please help!!
Murdoc is offline