Page 1 of 1

Image Resize Script

Posted: Wed Feb 13, 2008 9:37 am
by 01chris
I have written a script which uploads an image to my server and adds various details about the image to mysql. I now want to add to the script so that it makes a thumbnail of the image.

I am going to be using gif files and jpeg files only.

I have tried a number of tutorials but cant seem to make them work, please could somebody post some simple code to do this task?

The location and name of the file that i want resized is stored in the variable $thumb .

I want this file to be overwritten with the new resized file as I have a fullsized copy of the image stored elsewhere.

I would like the dimensions of the new image to be 128 wide by 160 high (I dont care if the thumbnail ends up stretched or out of proportion)

Thanks

Re: Image Resize Script

Posted: Wed Feb 13, 2008 10:16 am
by liljester
have you tried the imagecopyresampled() function?

Re: Image Resize Script

Posted: Wed Feb 13, 2008 10:32 am
by 01chris
i had tried that but it turns out i had been using it incorrectly - all seems well now

thank you liljester