PDA

View Full Version : [Suggestion] upload auto-shrink


cheesegrits
06-13-2006, 10:03 PM
Here's a feature which I think would be really convenient for people uploading their digital camera pics. Set an upload max file size, over and above the existing max file size. Let folk upload images up to the upload max, but automatically shrink them down to the standard max before saving them.

So for instance, let me set an upload max of 2MB, with a regular saved max size of 512KB. Then folk could upload 90% of their digital pix from cameras up to about 5 mega pixel without having to manually shrink them before uploading, which is often a pain. Gobbles a bit of bandwidth, but very convenient for the users, and keeps my disk usage to the same as before.

-- hugh

Morgan
06-14-2006, 01:16 AM
Will think about some other limits, but my first impressions are of memory and quality issues.

cheesegrits
06-14-2006, 02:24 AM
Just playing devils advocate here ...

I'm assuming you are using the standard choice of GD or ImageMagik, in which case image quality shouldn't be a problem. Especially as we are talking about creating images for display on a web page, at 80dpi. The standard thumbs you already create look great.

And as you seem to be doing the resampling into the three standard thumb sizes during the upload phase (I just peeked at the code), you could do those from the original large image, before resizing the uploaded file prior to saving it, so you don't have "resampling resampled images" issues.

As for memory ... if a site doesn't have enough memory, they wouldn't have to use this feature. Personally I'm setting up shop on a machine with 4GB, so I can afford to spend a bit of memory to make my users lives easier. :)

One of the main reasons I'm suggesting this, apart from user convenience, is actually for tech support reasons. One of the most common questions we've gotten in the past when we've provided upload features like this is "How do I shrink my picture so I can upload it". Being able to cut out 90% of those support calls would save a significant amount of money - each support call averages about $25 in total "cost of doing business".

Just my $0.25. Or $25.00. ;)

-- hugh

Morgan
06-14-2006, 03:06 AM
PhotoPlog currently uses the GD library. There isn't an on-the-fly option to shrink to a max of 512KB spot on. There is a quality parameter that you can pass, zero to 100, but that won't guarantee a specific maximum file size. Not sure it'd be worth process time to shrink repeatedly until the filesize is at most a certain limit though.

However, if you allow 2MB files for upload, and you have enough memory, PhotoPlog will use the filesize of the original upload when calculating upload limits. Dimensions don't really matter as long as the filesize is under the value set in the permissions. PhotoPlog also keeps the originals around to, for example, rebuild thumbnails.