Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm investigating what products are out there that will allow you to request images through a HTTP API in arbitrary image sizes. The server would behind a CDN but would still need to be able to handle a fair bit of traffic and be possibly load-balanced.

I've been tasked with writing such a service, but I wanted to do some due diligence to see what commercial or open source solutions are out there. Google has not been particularly helpful. It may be because I have been searching for the wrong term.

Third-party sites and services are out of the question because of corporate policies.

share|improve this question

closed as off-topic by Michael Hampton Sep 15 '14 at 17:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

By sizes do you mean file sizes or image height/width?

They may not necessarily allow "arbitrary" sizes but bandwidth-reducing proxies (aka "accelerators") recompress image files to shrink them, among other bandwidth-saving tricks. Wikipedia has a page about them with a list of options.

If mean to rescale images on the fly, that's basically what a thumbnail script does. A lot of them are run in advance, but there are others that are "on the fly". For instance CPAN's Imager module has an example CGI script that scales an uploaded image to 200x200.

share|improve this answer

You can use ImageMagick with php/perl/python. It will allow you to resize the image. The only catch here is that you want to cache the image, Ideally.

For making the image cache friendly you would have to redirect to a unique URL and will have to keep the state of the for every call for redirection.

example. which does resizing of example.jpg. For this to be cache able image.php sould return a url redirection.

For the second URL ensure that you have the correct expiration headers set so that the CDN can cache it. But you also have to maintain the mapping of to
because with every request for that image, the image.php script will be called.
For data synchronization in a load balanced scenario you have a nfs share or use rsync if a delay of few seconds is acceptable or use file upload via API (of course secure it) to synchronize data between the backend servers.

share|improve this answer
up vote 0 down vote accepted

I've found an open-source Apache module called mod_dims. It fits most of my requirements and it is quite speedy.

share|improve this answer

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