I'm the webmaster for a small social network and have noticed that images uploaded by users are taking a big portion of the capacity available. These are mostly JPEGs.

What solutions could I apply to reduce storage needs? Is there a way to reduce the size of images without affecting quality too much? Is there a service out there that could be used to store static files at a cheaper price (< 1GB/0.04 eurocents)?

Edit: Updated the question.

4 Answers 4


The Digital Inspiration website achieved 60% cost saving over regular hosting charges by moving static files including images to Amazon's S3 storage service. You could compare the features & charges of Amazon's service with other cloud storage services & consider moving all your images to a cloud-based storage service.

  • Would it be possible to have a script upload images to Amazon s3?
    – James P.
    Commented Mar 16, 2011 at 21:19
  • Amazon S3 has an API that you can use to upload programmatically. Here is a sample PHP script - anyexample.com/programming/php/…
    – mvark
    Commented Mar 17, 2011 at 2:49
  • I use S3 for storing large pdf's of Land Rover manuals for a hobby site and it is very easy to integrate it into your site. It is costing me $20 odd a month though but I am dishing out a lot of big files. I would prefer to host them on my server but the data traffic would impact on the rest of my clients so I have to keep it separate. Commented Mar 17, 2011 at 9:37

There are many options available for resizing images on the fly and there is even a PHP Image Resizer class specifically for this.

Netuts have a nice tutorial on this

  • This approach - using PHP's GD functions - would be a great way to reduce image size if you didn't need the full resolution images. You'd have to make sure your server was set up with that particular PHP extension, though.
    – Jacob Hume
    Commented Mar 16, 2011 at 17:35

Depending on the beginning quality of the images, a little optimization can go a long way. For instance, Photoshop usually saves very large JPEG image files - and bringing the quality down a notch can save a good percentage of the file size without losing too much quality.

A good way to start would be to run all of these images (after backing up the originals, of course) through a batch photo editor like Phatch.

  • Thank you for your suggestions Jacob. I forgot to mention that these images are mostly uploaded by users or generated from them. It'd be interesting to see if it's possible to carry out similar transformations using PHP. That way the site could be redone to automatically process each image when it's viewed.
    – James P.
    Commented Mar 16, 2011 at 12:20

I don't know the exact nature of your social network, but I will just throw this into the pool of answers.

SWFUpload is a flash & javascript based file upload tool that now supports image resizing on the client side (before the file is even uploaded to the server).

This could reduce storage space and server processing time.

Again, might not work for you, but for some folks it may be an option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.