Giter VIP home page Giter VIP logo

thumbor's Introduction

Join thumbor-bootcamp for a learning and contribution experience with โค๏ธ and ๐Ÿค— from the thumbor team

thumbor

Crop, resize, transform and much more, all on-demand and AI Powered


thumbor is trusted by hundreds of companies worldwide

Wikipedia trusts thumborย  Globo.com trusts thumborย  Vox Media trusts thumborย  Forbes trusts thumborย  Square trusts thumborย  Deliveroo trusts thumborย  Canal+ trusts thumborย  Terra trusts thumborย  nrc trusts thumborย  web.dev indicates thumbor for high-performance web sitesย  aws indicates thumbor for serverless image handling
and many more!

thumbor is a smart imaging service that enables on-demand cropping, resizing, applying filters and optimizing images.

Cropping photos automatically can be a frustrating experience with severed heads involved. thumbor uses AI for smart detection.

thumbor is an HTTP server and you can create as many different images as you want just by varying path parameters:

http://<thumbor-server>/300x200/smart/thumbor.readthedocs.io/en/latest/_images/logo-thumbor.png

You should see an image of the thumbor logo in 300x200.

Learn more about all you can do in thumbor's documentation.

โš™๏ธ Installation

Decide which installation option you want to use.

Option 1: pip

# thumbor with main dependencies only
pip install thumbor

# thumbor with OpenCV dependency
pip install thumbor[opencv]

# thumbor with all dependencies
pip install thumbor[all]

Option 2: Binary

sudo add-apt-repository ppa:thumbor/ppa
sudo aptitude update
sudo aptitude install thumbor

For more ways, please check out Installation.

Run

Running it is as easy as hit:

thumbor

After this, you can reach it on https://localhost:8888/unsafe/https://raw.githubusercontent.com/thumbor/thumbor/master/example.jpg

Troubles?

If you experience any troubles, try running:

thumbor-doctor

If you have a thumbor.conf file, you can use that to help thumbor-doctor:

thumbor-doctor -c thumbor.conf

If you still need help, please raise an issue. Remember to send your thumbor-doctor output in the issue:

thumbor-doctor --nocolor -c thumbor.conf

๐ŸŽฏ Features

  • supports all common images formats out of the box
  • intelligent cropping and resizing
  • blazing fast using caching
  • supports many storages (local storage, AWS S3, Rackspace, Ceph, ...)
  • AI-powered cropping based on face and feature detection (glasses, interesting points, ...)
  • integrated with many programming languages and frameworks and many more...
  • highly extensible

๐ŸŒŸ Awesome Goodies

awesome-thumbor is a curated list of all things thumbor. There you can find filters, storages, engines, loaders, docker images, extensions in your favorite language and framework, and much more.

All of it with a clear indication of each project's quality. Have fun!

๐Ÿ‘ Contribute

thumbor is an open-source project with many contributors. Join them contributing code or contributing documentation.

If you use thumbor, please take 1 minute and answer this survey? Only 2 questions!

Join the chat at https://gitter.im/thumbor/thumbor

๐Ÿ‘€ Demo

You can see thumbor in action at http://thumborize.me/

thumbor's People

Contributors

bladrak avatar cameronnemo avatar cezarsa avatar cristiandean avatar dependabot[bot] avatar devppjr avatar dhardy92 avatar fabiomcosta avatar gcirne avatar guilhermef avatar heynemann avatar kevin1024 avatar kkopachev avatar lukaselmer avatar marcelometal avatar masom avatar not-a-kiwi avatar okor avatar phoet avatar rafaelcaricio avatar raphaelvrossi avatar rfloriano avatar rodrigolourenco avatar savar avatar scorphus avatar seichner avatar swankjesse avatar wichert avatar wking avatar znerol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thumbor's Issues

Allow users to use a fit-in flag

Allow users to use a fit-in flag that specifies that the generated image MUST fit in the given width and height but keep the same proportion as the original.

Command-line application to generate urls

We need to write a console app that gets installed alongside thumbor that allows users to call:

thumbor-encrypt --security-key="my-security-key" --width=300 --height=300 --smart /path/to/image.jpg

that outputs the encrypted url to help users easily obtain the url where toolkits are not available.

Auto-Contrast

Create an auto-contrast filter, like:

/filter('auto-contrast')

Allowed Sources has to be more flexible

AllowedSource has to be:

  • Optional

Format has to change to be:

  • Wildcarded - .mydomain.com
    ("
    .globo.com", "*.glbimg.com")
  • Regular Expression
    (r"(.+)[.]globo[.]com", r"(.+)[.]glbimg[.]com"

Use tornado's AsyncHttpClient

Currently thumbor's http_loader can only download one file at a time because it uses tornado's blocking http client. This causes image downloads to take a lot longer than they should.

You should pass a callback to the loader which will be called to process the image once the download is complete.

There isn't much point to your using tornado currently since you are blocking when loading images.

Watermark filter

Allow users to pass a watermark to be added to the center of the image.

/filter('watermark', 'my.domain.com/watermark.png')

Create Filter Infrastructure

Allow specification of filters in configuration like:

Filters = [
"thumbor.filters.dropshadow",
"thumbor.filters.blur",
#etc
]

Filters should be added to the url like:

/300x200/smart/filter('blur', 0.3, 'gaussian')/my/image.jpg

The formation of filters is:

/filter('key', argument1, argument2, ...)

We can add a very simple filter in this story to test the infrastructure like the blur filter above.

Drop Shadow Filter

Drop a shadow "behind" the image.

/filter('shadow', 45, '#333', 0.8)

Arguments are angle, color and alpha percentage.

Exception when running thumbor-url

Trying to run thumbor-url with the latest version off of github.

Stacktrace:

thumbor thumbor-url http://google.com/cheese.jpg
Traceback (most recent call last):
File "/usr/local/topsoil_virtualenv/bin/thumbor-url", line 8, in
load_entry_point('thumbor==2.3.0', 'console_scripts', 'thumbor-url')()
File "/usr/local/topsoil_virtualenv/lib/python2.7/site-packages/thumbor/url_composer.py", line 50, in main
conf_file = ThumborServiceApp.get_conf_file('')
AttributeError: type object 'ThumborServiceApp' has no attribute 'get_conf_file'

Maybe something to do with latest version of tornado?

Rounded Corners Filter

Create a rounded corners filter, like:

/filter('rounded', 3, 3, 3, 3)

With the four arguments being the top-left, top-right, bottom-left and bottom-right corner radius in pixels.

Remove imagemagick engine

Simply because pythonmagickwand causes great pain and suffering to install and work with.
The other engines work great and pythonmagickwand doesn't provide any great advantage that would justify going through the hassle of maintaining it.

Python toolkit

Create a python toolkit to expose the encrypt and decrypt functions of the crypto module in thumbor.

OpenCV File Issue

We have an issue that OpenCV does not deal properly with PIL's images, so it would be worth it if there was an actual file in the filesystem for OpenCV to Load.

This could be implemented with Python's namedtempfile.

The pypi packages does not install face detection xml files

The face detection supplementary XML files are not installed when installing using pip or easy_install. Thumbor crashes saying OpenCV returned a null value.


Traceback (most recent call last):
File "/path/to/thumbor/virtualenv/lib/python2.6/site-packages/tornado/web.py", line 861, in _execute
getattr(self, self.request.method.lower())(_args, *_kwargs)
File "/path/to/thumbor/virtualenv/lib/python2.6/site-packages/tornado/web.py", line 941, in wrapper
return method(self, _args, *_kwargs)
File "/path/to/thumbor/virtualenv/lib/python2.6/site-packages/thumbor/handlers.py", line 268, in get
return self.execute_image_operations(opt, image)
File "/path/to/thumbor/virtualenv/lib/python2.6/site-packages/thumbor/handlers.py", line 74, in execute_image_operations
opt['smart'], image)
File "/path/to/thumbor/virtualenv/lib/python2.6/site-packages/thumbor/handlers.py", line 143, in get_image
self._fetch(image, extension, callback)
File "/path/to/thumbor/virtualenv/lib/python2.6/site-packages/thumbor/handlers.py", line 171, in _fetch
callback(buffer)
File "/path/to/thumbor/virtualenv/lib/python2.6/site-packages/thumbor/handlers.py", line 131, in callback
self.detectors[0](index=0, detectors=self.detectors).detect(context)
File "/path/to/thumbor/virtualenv/lib/python2.6/site-packages/thumbor/detectors/face_detector/init.py", line 26, in init
self.load_cascade_file(file, options.FACE_DETECTOR_CASCADE_FILE)
File "/path/to/thumbor/virtualenv/lib/python2.6/site-packages/thumbor/detectors/init.py", line 43, in load_cascade_file
setattr(self.class, 'cascade', cv.Load(cascade_file))
TypeError: OpenCV returned NULL

Optional Image(domain)-URL named based

Unlike display the full URL address, display a name that the thumbor service recognizes (optional):
http:///unsafe/300x200/smart/glb1/et/bb/f/original/2011/03/24/VN0JiwzmOw0b0lg.jpg

http:///unsafe/300x200/smart/glb2/et/bb/f/original/2011/03/24/VN0JiwzmOw0b0lg.jpg

glb1 => s.glbimg.com
glb2 => s2.glbimg.com

Thanks

NoStorage Storage

Create a NoStorage class that always returns False in the exists method and does nothing in the save method.

This is a storage for debugging or benchmarking purposes and should not be used in prod.

URL cryptography support

Support cryptography using a salt in the form of:

/cryptographed_url/some/nice/image.jpg

Then cryptographed url corresponds to:

/300x300/smart/image_path_hash/some/nice/image.jpg

The image path hash bit is to ensure that the original image path that was used for this size was for this url (to prevent tampering with the url).

install pycrypto

Hi Fabio,

I'm new to python and have some trouble get your thumbor running on my ubuntu regarding the Crypto.Cipher lib

I run setup.py, installed pycrypto and started app.py , but got an exception:

File "app.py", line 21, in
from thumbor.handlers.crypto import CryptoHandler
File "/usr/local/lib/python2.6/dist-packages/thumbor-0.8.3-py2.6.egg/thumbor/handlers/crypto.py", line 15, in
from thumbor.crypto import Crypto
File "/usr/local/lib/python2.6/dist-packages/thumbor-0.8.3-py2.6.egg/thumbor/crypto.py", line 14, in
from Crypto.Cipher import AES
ImportError: cannot import name AES

I even placed the Crypto source in thumbor/Cryptor and run a test app:

from Crypto.Cipher import DES3
from Crypto.Cipher import AES

In that case I did not get an error.

Fabio, do you know what I'm doing wrong?

cheers
seb

Create a debug flag

This debug flag would draw rectangles for the faces detected and a point on the calculated center of mass on the image, so we can see easily if the face detection is working fine.

Default Config depends on OpenCV

Not sure if this is actually a bug, but the default config includes stuff that depends on opencv, which doens't allow you to just do pip install thumbor and run it.

Downloading is very slow

Downloading even for files that have already been cached and stored in the file storage is very slow. On my local machine files that are only 55kb take over a second to load in the browser for each file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.