Ask HN: image scaling on the fly
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.
[+] [-] hernan7|15 years ago|reply
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
[+] [-] hkuo|15 years ago|reply
[+] [-] Mentat_Enki|15 years ago|reply
[+] [-] Erlend|15 years ago|reply
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
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
[+] [-] thinkzig|15 years ago|reply
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
[+] [-] hkuo|15 years ago|reply
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] anathem|15 years ago|reply
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
[+] [-] macca321|15 years ago|reply
If you want one developed, please contact me, my email is on my blog @ http://www.adverseconditionals.com
[+] [-] cromulent|15 years ago|reply
[+] [-] audionerd|15 years ago|reply
[+] [-] wan23|15 years ago|reply
[+] [-] anarchitect|15 years ago|reply
[+] [-] Erlend|15 years ago|reply
[+] [-] theIntuitionist|15 years ago|reply
[+] [-] tjarratt|15 years ago|reply
You should set up a landing page at least, so visitors don't just see /www directory.
[+] [-] Concours|15 years ago|reply
[+] [-] l4u|15 years ago|reply
[+] [-] Erlend|15 years ago|reply