
Show HN: Thumbor – open-source on-demand image cropping, resizing, and filters - heynemann
http://thumbor.org
======
cfstras
> By upgrading your image server to thumbor you would go from 12989.07kb to
> 16106.04kb for 22 images (using WebP images).

On my gallery page:

> By upgrading your image server to thumbor you would go from 16687.68kb to
> 29581.33kb for 19 images (using WebP images).

All of my images get filtered through convert through convert(1) -quality 90,
could that be a reason?

~~~
heynemann
Yes. Sometimes thumborize.me will get the image sizes weirdly. It's there
mainly to give you an idea. The settings are the standard ones that come with
thumbor. If you tinker with the settings you always get best results. I highly
encourage you to try it on your site with different quality settings. Setting
up thumbor in your machine takes like 2 minutes. Have a look at the getting
started page. If you need any further help please do not hesitate to create an
issue and we'll most definitely help you.

------
hcarvalhoalves
Dealing with on-demand thumbnails is annoying, I've done something similar in
the past [1].

In any case, transparently generating thumbnails from URLs is the saner
solution, designers/editors might want to embed image of all sorts of sizes
and aspect ratios and you can't always generate everything in batch - this is
extremely common on news sites.

[1] [https://github.com/hcarvalhoalves/django-rest-
thumbnails](https://github.com/hcarvalhoalves/django-rest-thumbnails)

~~~
hackerboos
Anybody know of a rails equivalent?

~~~
gingerlime
It looks like you could use thumbor (or any similar solution) as an external
resource[0], so it doesn't matter what language it's written in.

That said, it usually feels safer to have something that works with the same
stack.

We're using carrierwave, and it's pretty neat, but we had a few times where we
had to scale thumbnails differently, and it turned out to be a pretty long
batch operation, especially since we're storing images on S3.

I think that 'on-the-fly' conversion and caching could work better for larger
sites that tend to change. Pre-processing doesn't scale so well.

[0] take a look at
[https://github.com/rafaelcaricio/thumbor_rails](https://github.com/rafaelcaricio/thumbor_rails),
which I believe is using [https://github.com/thumbor/ruby-
thumbor](https://github.com/thumbor/ruby-thumbor)

EDIT: added links

------
p4bl0
Nice work!

> By upgrading your image server to thumbor you would go from 0kb to 0kb for 0
> images, thus saving NaN% (using WebP images).

Maybe a special message could be used in this specific case.

~~~
heynemann
Yep, that happens when we don't find any images in the DOM. I'll work it out
to improve the wording...

------
aidanfeldman
A similar app I worked on, which focuses on extensibility:
[http://magickly.afeld.me/](http://magickly.afeld.me/)

~~~
heynemann
Not sure how it compares, but thumbor is fully extensible. There are people
using it with HBase, others with Amazon's S3 and Cloudfront, others with
filesystem based solutions and yet others with redis or mongo backed images.
Other than storage, you can extend loading images from different places, as
well as changing the imaging library thumbor uses. You can also extend the
filters or the detection mechanisms. Anyway, good to know about magickly.

~~~
gingerlime
any tips on plugging-in any 3rd party image processing filters? Maybe I looked
in the wrong place, but could only see storage plugins on the wiki.

For example, we have a ruby-based library for converting images for different
types of colour-blindness[0]. It's available from ruby, or via the command
line. How could we use it as a filter in thumbor?

[0] [https://github.com/kenhub/shikimo](https://github.com/kenhub/shikimo)

~~~
heynemann
It can be easily implemented as a filter[1][2]. If you need to use it via
command-line you can save the current buffer as a tempfile[3], call your CLI
with the tempfile path and read the tempfile to use as the new buffer.

It's even simpler if your CLI can take a stdin argument, since you can just
pass the buffer as a stdin parameter.

Thumbor's filter infrastructure allows you to change the image incrementally.

[1]
[https://github.com/thumbor/thumbor/wiki/Brightness](https://github.com/thumbor/thumbor/wiki/Brightness)

[2]
[https://github.com/thumbor/thumbor/blob/master/thumbor/filte...](https://github.com/thumbor/thumbor/blob/master/thumbor/filters/brightness.py)

[3]
[https://docs.python.org/2/library/tempfile.html](https://docs.python.org/2/library/tempfile.html)

------
ceejayoz
This looks like it has come a long way since the last time I played with it.
We wound up building something internally, but it might be time to re-eval.

------
morenoh149
on firefox maybe you should display a dummy webp image. Seems like FF doesn't
support it yet, you should degrade gracefully in this case.

~~~
heynemann
Just saw it. You are absolutely right. My bad... Will fix it tomorrow.

~~~
exceptione
Some people might downvote me for this (as happened before) but I have cookies
disabled by default. Only if I need to interact with a website I am ok with
traces and I allow cookies for that domain via the Cookie Controller add-on.

Now the strange thing: thumbor requires cookies in order to serve images. It
requires quite lax settings since allowing cookies for thumborg.org as first
party only doesn't suffice. I need to accept all possible cookies, I think
because one offending cookie has domain .thumborg.org.

I think serving images should not depend on cookies, or is there a good
reason?

------
fourstar
By upgrading your image server to thumbor you would go from 0kb to 0kb for 0
images, thus saving NaN% (using WebP images).

Did I break it?

~~~
heynemann
What website did you put into it? If your site loads images via javascript we
don't capture it...

~~~
ZoF
Would definitely recommend showing a message akin to 'no images detected' in
that event.

Maybe with a few common reasons that might happen(such as the above)

Cool stuff though!

------
tuananh
> saving NaN%

LOL

[https://dl.dropbox.com/s/o8o544awvvw92on/thumborize.me_-
_Tes...](https://dl.dropbox.com/s/o8o544awvvw92on/thumborize.me_-
_Test_results_for_httptuananh.orgimagesdownload-speed-from-
seedbox_2014-09-10_22-00-50.jpg?dl=0)

