Skip to content

scorphus/thumbor-wand-engine

Repository files navigation

thumbor-wand-engine

Build Status Coverage Status Code Quality Maintainability

thumbor-wand-engine is an ImageMagick imaging engine for thumbor.

Installation

You can install the package from PyPI with pip:

$ pip install thumbor-wand-engine

Requirements

  • Python 3.7 or higher
  • MagickWand library
    • libmagickwand-dev for APT on Debian/Ubuntu
    • ImageMagick-devel for Yum on CentOS
    • imagemagick for MacPorts/Homebrew on Mac

Why another engine

Thumbor ships with a builtin engine, however with thumbor-wand-engine you get:

  • Smaller images ⏳ πŸ’²
  • Better image quality 🀩
  • Support to animated WEBP ⏳ πŸ’²
  • Support to AVIF and HEIC πŸ–Ό
  • IPTC/XMP data preservation πŸ“œ
  • Smoother blur ✨
  • Sharper resizing πŸ“
  • Better watermarking 🏷

Usage

To use this engine with thumbor, define thumbor_wand_engine as the imaging engine in thumbor.conf:

# imaging engine to use to process images
ENGINE = "thumbor_wand_engine"

Development

Requirements

  • Python 3.6 or higher
  • An activated virtual environment
  • pre-commit

Create a development environment

  1. Start by creating a new Python virtual environment with the tool of your choice (we recommend pyenv)

  2. Install pre-commit (we recommend installing it not as part of the virtual environment β€”Β use your system's package manager)

  3. Install thumbor-wand-engine in editable mode with all required dependencies:

    $ make setup
    

Run tests

Once you have a working development environment:

  1. Code!

    πŸ€“ πŸ€” πŸ’‘ ⚑️ πŸ–Ό
    
  2. Run tests

    $ make test
    
  3. Check code coverage

    $ make coverage-html
    $ open htmlcov/index.html
    
  4. Lint the code:

    $ make lint
    
  5. Repeat!

Have fun!

License

Code in this repository is distributed under the terms of the MIT License.

See LICENSE for details.