thumpy


Namethumpy JSON
Version 0.4.2 PyPI version JSON
download
home_pagehttps://github.com/btubbs/thumpy
SummaryA Python web server that uses Pillow to dynamically scale, crop, transform and serve images from S3 or the local filesystem
upload_time2017-02-10 00:04:48
maintainer
docs_urlNone
authorBrent Tubbs/Berry Phillips
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
Coveralis test coverage No Coveralis.
            Meet Thumpy
===========

Thumpy is a Python web service that crops and scales images.  It doesn't store
anything.  It's meant to be used as an origin server sitting behind a CDN such
as Amazon CloudFront.

Configuration
=============

Settings are stored in the settings.yaml file. They should include:
- the name and access keys to your S3 bucket
- compression quality (e.g. 80)
- list of CORS allowed hosts

Interface
=========

Thumpy serves images using the same paths as their storage location on S3.
Conversion parameters are specified in the query string, using an interface
inspired by `TimThumb
<http://www.binarymoon.co.uk/projects/timthumb/>`_.

examples:

Scaling
~~~~~~~

Scale the width to 200px, and the height proportionally::

  http://mythumpyserver.somewhere/castle.jpg?w=200

Scale the height to 150px, and the width propotionally::

  http://mythumpyserver.somewhere/castle.jpg?w=200

Specify both height and width::

  http://mythumpyserver.somewhere/castle.jpg?w=200&h=150

Scaling (Post processing)
~~~~~~~~~~~~~~~~~~~~~~~~~
Same as Scaling (above) but applied to the output image after all transformations

  http://mythumpyserver.somewhere/castle.jpg?pw=200&ph=150

Cropping
~~~~~~~~

Crop the width to 200 and the height to 100::

	http://mythumpyserver.somewhere/castle.jpg?cw=200&ch=100

Crop the width and height to 50::

	http://mythumpyserver.somewhere/castle.jpg?cw=50&ch=50

- Thumpy will always scale first before any cropping.
- Thumpy always crops from the center of the image.

Reveal Mask / Zoom Cropping
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Minimum 3 parameters required:
- Top offset (e.g. zct=100px)
- Left offset (e.g. zcl=100px)
- Width or Height of the output crop from the offsets. If only one is provided the other will automatically be assigned the other's value.

The mask should be applied to the original image which means there is no scaling but only masking.

See: Scaling (Post processing) to get the scaled mask/crop.

Get 100px x 50px scaled crop off a larger image with a reveal mask of 350px x 175px applied at 20px x 10px top-left offset.

    http://mythumpyserver.somewhere/castle.jpg?zcw=350&zch=175&zct=20&zcl=10&pw=100&ph=50


Greyscale
~~~~~~~~~

Example of a greyscale image with no resizing::
	http://mythumpyserver.somewhere/castle.jpg?gray=1

            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "cheesecake_code_kwalitee_id": null, 
    "coveralis": false, 
    "keywords": "", 
    "upload_time": "2017-02-10 00:04:48", 
    "author": "Brent Tubbs/Berry Phillips", 
    "home_page": "https://github.com/btubbs/thumpy", 
    "github_user": "btubbs", 
    "download_url": "https://pypi.python.org/packages/da/1f/fcd8affbf8c2db1eb0df4250de1d7cdfa4a52147d35c257cecca22c329ed/thumpy-0.4.2.tar.gz", 
    "platform": "", 
    "version": "0.4.2", 
    "cheesecake_documentation_id": null, 
    "description": "Meet Thumpy\n===========\n\nThumpy is a Python web service that crops and scales images.  It doesn't store\nanything.  It's meant to be used as an origin server sitting behind a CDN such\nas Amazon CloudFront.\n\nConfiguration\n=============\n\nSettings are stored in the settings.yaml file. They should include:\n- the name and access keys to your S3 bucket\n- compression quality (e.g. 80)\n- list of CORS allowed hosts\n\nInterface\n=========\n\nThumpy serves images using the same paths as their storage location on S3.\nConversion parameters are specified in the query string, using an interface\ninspired by `TimThumb\n<http://www.binarymoon.co.uk/projects/timthumb/>`_.\n\nexamples:\n\nScaling\n~~~~~~~\n\nScale the width to 200px, and the height proportionally::\n\n  http://mythumpyserver.somewhere/castle.jpg?w=200\n\nScale the height to 150px, and the width propotionally::\n\n  http://mythumpyserver.somewhere/castle.jpg?w=200\n\nSpecify both height and width::\n\n  http://mythumpyserver.somewhere/castle.jpg?w=200&h=150\n\nScaling (Post processing)\n~~~~~~~~~~~~~~~~~~~~~~~~~\nSame as Scaling (above) but applied to the output image after all transformations\n\n  http://mythumpyserver.somewhere/castle.jpg?pw=200&ph=150\n\nCropping\n~~~~~~~~\n\nCrop the width to 200 and the height to 100::\n\n\thttp://mythumpyserver.somewhere/castle.jpg?cw=200&ch=100\n\nCrop the width and height to 50::\n\n\thttp://mythumpyserver.somewhere/castle.jpg?cw=50&ch=50\n\n- Thumpy will always scale first before any cropping.\n- Thumpy always crops from the center of the image.\n\nReveal Mask / Zoom Cropping\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\nMinimum 3 parameters required:\n- Top offset (e.g. zct=100px)\n- Left offset (e.g. zcl=100px)\n- Width or Height of the output crop from the offsets. If only one is provided the other will automatically be assigned the other's value.\n\nThe mask should be applied to the original image which means there is no scaling but only masking.\n\nSee: Scaling (Post processing) to get the scaled mask/crop.\n\nGet 100px x 50px scaled crop off a larger image with a reveal mask of 350px x 175px applied at 20px x 10px top-left offset.\n\n    http://mythumpyserver.somewhere/castle.jpg?zcw=350&zch=175&zct=20&zcl=10&pw=100&ph=50\n\n\nGreyscale\n~~~~~~~~~\n\nExample of a greyscale image with no resizing::\n\thttp://mythumpyserver.somewhere/castle.jpg?gray=1\n", 
    "lcname": "thumpy", 
    "bugtrack_url": null, 
    "github": true, 
    "name": "thumpy", 
    "license": "", 
    "travis_ci": true, 
    "github_project": "thumpy", 
    "summary": "A Python web server that uses Pillow to dynamically scale, crop, transform and serve images from S3 or the local filesystem", 
    "split_keywords": [], 
    "author_email": "brent.tubbs@gmail.com/berryphillips@gmail.com", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2017-02-10T00:04:48", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/da/1f/fcd8affbf8c2db1eb0df4250de1d7cdfa4a52147d35c257cecca22c329ed/thumpy-0.4.2.tar.gz", 
            "md5_digest": "56340a49cb1e45c0f64362323d15bb36", 
            "downloads": 0, 
            "filename": "thumpy-0.4.2.tar.gz", 
            "packagetype": "sdist", 
            "path": "da/1f/fcd8affbf8c2db1eb0df4250de1d7cdfa4a52147d35c257cecca22c329ed/thumpy-0.4.2.tar.gz", 
            "size": 484061
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}