Image Resizing and Compression
- by GSTAR
Hi guys,
I'm implementing an image upload facility for my website. The uploading facility is complete but what I'm working on at the moment is manipulating the images. For this task I am using PHPThumb (http://phpthumb.gxdlabs.com).
Anyway as I go along I'm coming across potential issues, to do with resizing and compression. Basically I want to acheive the following results:
The ideal image dimensions are: 800px width, 600px height. If an uploaded image exceeds either of these dimensions, it will need be resized to meet the requirements. Otherwise, leave as it is.
The ideal file size is 200kb. If an uploaded image exceeds this then it will need to be compressed to meet this requirement. Otherwise, leave as it is.
So in a nutshell: 1) Check the dimensions, resize if required. 2) Check the filesize, compress if required.
Has anybody done anything like this / could you give me some pointers? Is PHPThumb the correct tool to do this in?