Giter VIP home page Giter VIP logo

libthumbor'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/

libthumbor's People

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

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

libthumbor's Issues

PyCrypto should be optional

It seems like the PyCrypto dependency is not required if you only want to generate new style urls. I suggest moving the check out of __init__ and into generate_old.

Create a new release after adding python3 support

Hi, I noticed you recently added python3 support. Would be great if you could create a new release with these additions as I'm working on porting another component that uses this library to python 3.

Many Thanks

django templatetag

What about a django template tag?

Ex:
{% thumbor_url image-source **thumbor_options %}

names can be changed of course, this is just an idea for the interface.

libthumbor is not being detected as a python3 compatible

Hi,

I'm confusing about py3 support on this project.

Check python compatibility version

The site Can I use Python3 indicates that libthumbor is blocking me to go to python3:

  • libthumbor (which is blocking django-thumbor)

Reading the issues, the issue #18 release a new version that is compatible with py3.

The site uses the setup.py info to know if the project is or not py3 compatible.
This file contains trove classifiers and once python 2.6 is indicated to be compatible.

In summary, we need to add the 3.x version in this file, to the project really be detected as a py3 compatible project.

Contributing Guidelines

Looking the Contributing Guidelines, I found this:

You'll also need python >= 2.6 and < 3.0.

Again, I assume that anyone forgot to change this information.

Thanks!

urls.py not compatible with Django 2.1

Traceback (most recent call last):
  File "/usr/lib64/python3.7/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/home/abuild/rpmbuild/BUILD/libthumbor-1.3.2/libthumbor/django/urls.py", line 4, in <module>
    from django.conf.urls import patterns, url
ImportError: cannot import name 'patterns' from 'django.conf.urls' (/usr/lib/python3.7/site-packages/django/conf/urls/__init__.py)

CryptoURL constructor cannot accept unicode key

key = u'a-secret-string'
crypto = CryptoURL(key=key)
encrypted_url = crypto.generate(width=300,
... height=200,
... smart=True,
... image_url=image_url)
Traceback (most recent call last):
File "", line 4, in
File "/Library/Python/2.7/site-packages/libthumbor/crypto.py", line 61, in generate
return self.generate_new(options)
File "/Library/Python/2.7/site-packages/libthumbor/crypto.py", line 48, in generate_new
signature = base64.urlsafe_b64encode(hmac.new(self.key, unicode(url).encode('utf-8'), hashlib.sha1).digest())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hmac.py", line 133, in new
return HMAC(key, msg, digestmod)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hmac.py", line 72, in init
self.outer.update(key.translate(trans_5C))
TypeError: character mapping must return integer, None or unicode

Url and Signer should be part of libthumbor

I can take care of the move, but first I want a second opinion to check that my logic is correct.

Currently, the libthumbor tests depend on thumbor, but that dependency is implicit. Specifically, tests/test_libthumbor.py imports Signer from thumbor.crypto and Url from thumbor.url

This creates an annoying circular dependency which makes packaging libthumbor difficult.

However, Signer and Url are both standalone classes. Therefore they look easy to move to libthumbor. By doing so, there would be a much cleaner separation between both modules and packaging of libthumbor would become easier.

Does this move make sense?

Manual crop not working

In the docs refers a way to crop manually the image:
https://github.com/thumbor/thumbor/wiki/Usage#manual-crop

It's working when I use directly in URL, using this way in image size: AxB:CxD.
Example: THUMBOR_SERVER/unsafe/0x400:1280x600/smart/IMAGE_URL

But it doesn't work when I try to use this calling CryptoURL().generate() passing crop_left, crop_top, crop_right, crop_bottom attributes in kwargs.

Like this example here.

Is something wrong or there is other way to do this manual crop?

Double slashs concatenation on plain_image_url

Hi all. I'm using this lib and I found that on plain_image_url:
If the image_url starts with slash / the final url has a double slash // and generate a broken URL.

Example: /bvTS4YYs7n3iuy-fYSUfSd9ss6w=/fit-in/200x200/filters:quality(50)//media/pages/10/BARRAS_01.jpg

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.