top | item 1561672

Ask HN: image scaling on the fly

9 points| Erlend | 15 years ago | reply

Hi,

I've built some mobile sites & apps the last few years and rescaling images keeps popping up.

Ideally I would want something like this:

http://scal.er/w40-a1:1/http://path/to/image

this would generate a square thumb, 40x40.

I would be willing to pay for such a service.

26 comments

order
[+] hernan7|15 years ago|reply
Why not use ImageMagick?

I have used it to create thumbnails for a demo website and they looked OK. Does it have any performance/ aliasing/ whatever issues I'm not aware of?

[+] johngunderman|15 years ago|reply
ImageMagick is gold for this sort of thing. I'm actually working with it as I type :)
[+] hkuo|15 years ago|reply
I've used ImageMagick and it works great. Though I think many average developers who don't tinker with servers would have a harder time picking it up.
[+] Mentat_Enki|15 years ago|reply
Was there a question being asked here? If you are looking for a programmer-for-hire, there are freelance sites for that sort of thing. This isn't even an hard/interesting problem, and anyone who could "build a mobile site/app" should be able to code up this trivial service in minutes.
[+] Erlend|15 years ago|reply
Sorry, I wasn't clear enough earlier.

I have used imagemagick/GD previusly, but there are some hassle involved in setting up this for each project/client (cron job for cleaning up thumbs, space considerations, not all ISP I use for clients have GD installed etc)

I agree that writing an ad-hoc image scaler is simle.

However, writing a quality general one that handles different formats, image quality, aspect ratio, smart cropping etc..is not trivial.

[+] andrewingram|15 years ago|reply
At work I developed a wsgi script that use Python Imaging Library to resize images on demand. You can see it in action here:

http://dyn4.media.forbiddenplanet.com/products/2148557.jpg.s... http://dyn4.media.forbiddenplanet.com/products/2148557.jpg.s...

Basically, if you chop off the dyn4 sub-subdomain and everything after .jpg you can see the original unmodified image. You can also change the extension at the end to change the format of the image (jpg,png or gif). We cache the files to /tmp which we periodically clear out. Whilst it might be more efficient of going down the route of pre-generating all the images we'll need, it's very convenient being able to do it on the fly and to be honest for a site of our size (225,000 visits/month) it's barely a spec on the CPU load of our media server.

There's also an apache module that uses ImageMagick to do something similar:

http://github.com/beetlebugorg/mod_dims

I have to be honest though, I prefer the API for my version and it gives the files a meaningful name in the /tmp folder as well as the user's internet history.

Unfortunately my version isn't open source (yet?) and the code is a bit of a mess, but it's something we have considered opening up.

[+] raystar|15 years ago|reply
There is http://imagejuicer.com/, that seems to do what you want.
[+] thinkzig|15 years ago|reply
Has anyone here used Image Juicer?

It looks interesting but I found the documentation page to be pretty lacking. The simple example they show just allows you to pass a height and width parameter, but the home page says you can do cropping, watermarking, etc.

[+] Erlend|15 years ago|reply
Thanks, but looks like its mainly for background jobs and not built to serve images on the fly.
[+] hkuo|15 years ago|reply
This looks like the answer.
[+] anathem|15 years ago|reply
I'm currently wrapping up work on an image processing module with a client. If you want I could build a dedicated service for you.

If you are running your own site, and using nginx, there's an image processing module for it that is a match for your requirement: http://wiki.nginx.org/NginxHttpImageFilterModule

[+] Erlend|15 years ago|reply
Thanks for that, but Im looking for a "pay as you go" service.
[+] audionerd|15 years ago|reply
I've been impressed with Dragonfly, "a Rack-based ruby gem for [image] processing/encoding on the fly"

  http://blog.new-bamboo.co.uk/2010/1/2/dragonfly
[+] wan23|15 years ago|reply
I've thought the same thing. Seems like something that needs to be done over and over. It seems like a good potential business idea as long as it's cheap enough.
[+] anarchitect|15 years ago|reply
I think urlimg might be what you are looking for... http://urlimg.com/
[+] Erlend|15 years ago|reply
Thanks, will take a closer look, but pricing seems off (1 cent/mb/month over 50mb)
[+] theIntuitionist|15 years ago|reply
I'd be happy to build you such a service. Would be quite simple. email me- [email protected]
[+] tjarratt|15 years ago|reply
Off topic, but why do you have all of your files browsable at http://idont.no ?

You should set up a landing page at least, so visitors don't just see /www directory.