class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
Your Class is short of complete because of the following reasons
1) cant upload animated gifs
2) Sizing concerns when it cannot get the width and height prior to processing...
Many users like resizing their uploads where they constrain by either X or Y axis then apply the x or y image_ratio_ <- this logic is flawed.
Now here is the BIG@#$ problem:
Assume users would occasionally upload a portrait and occasionally a landscape image.
Dilemma: if he sets the x to fixed value and leave y auto ratio, THEN the user will have problems when he uploads a portrait oriented image because all the portraits will appear significantly larger than the landscapes
Example A: Original file X=800 Y=600 (Landscape) Constrain X to 400, Y to auto Uploads and processed to X=400 Y=auto (which is 300) Total pixels = 400X300=120,000
Example B: Original file X=600 Y=800 (Portrait) Constrain X to 400, Y to auto (Same rule as above) Uploads and processed to X=400 Y=auto (which is 534) Total pixels = 400X534=213,600!!!!!
BUT then we have image_ratio_pixels right? just set -> image_ratio_pixels=120000 problem solved?
Wrong then comes the problem when we have images that are smaller and we do now wish to scale due to loss of image quality, so u say just use -> image_ratio_no_zoom_in
BUT then you say "You can use only one of the image_ratio_* setting at the same time. "
1) cant upload animated gifs
2) Sizing concerns when it cannot get the width and height prior to processing...
Many users like resizing their uploads where they constrain by either X or Y axis then apply the x or y image_ratio_ <- this logic is flawed.
Now here is the BIG@#$ problem:
Assume users would occasionally upload a portrait and occasionally a landscape image.
Dilemma: if he sets the x to fixed value and leave y auto ratio,
THEN the user will have problems when he uploads a portrait oriented image because all the portraits will appear significantly larger than the landscapes
Example A: Original file X=800 Y=600 (Landscape)
Constrain X to 400, Y to auto
Uploads and processed to X=400 Y=auto (which is 300)
Total pixels = 400X300=120,000
Example B: Original file X=600 Y=800 (Portrait)
Constrain X to 400, Y to auto (Same rule as above)
Uploads and processed to X=400 Y=auto (which is 534)
Total pixels = 400X534=213,600!!!!!
BUT then we have image_ratio_pixels right?
just set -> image_ratio_pixels=120000 problem solved?
Wrong then comes the problem when we have images that are smaller and we do now wish to scale due to loss of image quality, so u say just use -> image_ratio_no_zoom_in
BUT then you say "You can use only one of the image_ratio_* setting at the same time. "
Then we are just back to SQUARE ONE!