Jump to content

image resize dilemma


geroid

Recommended Posts

Hi all

I'm writing an image upload script at the moment. I'm finding it very tricky to decide on what to allow in terms of image size. I want my images to be examined for size which I'm doing.

If the image is greater than 600 px in width, then I'm resizing it down to 600 px and uploading to the folder. That's ok.

If the image is greater than 200 px but less than 600 px then I leave it alone and upload it to the folder. That's ok too.

But what if the image is less than 200 px (say 50px). I want all my images to appear on the webpage at 200 px so in the case of this 50 px image I would have to resize it up to 200 px. This leads to really bad pixalation, in fact the image is unusable.

 

So my question is how do I handle such small images. Should I just reject them and tell the user "This image is too small for the website".

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/164760-image-resize-dilemma/
Share on other sites

"Should I just reject them and tell the user "This image is too small for the website"."

 

Exactly.  On the upload form you should have something stating min and max resolution and after the upload have your script check to see if it falls in that range.

 

If it is too small then reject it and bounce the user back to the upload screen with an error stating too small.  It also would be helpful to state what the image uploaded actually was for the "not so smart" user who has no idea what resolution means.

 

Failed Upload, Image Size (height x width) does not fall within allowed resolution.

Link to comment
https://forums.phpfreaks.com/topic/164760-image-resize-dilemma/#findComment-868829
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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