Skip to main content

Image transforming WSGI middleware

Project description

This package provides a WSGI middleware component which transforms and converts image streams using PIL.

Usage

The middleware works by looking for a “traversing directive”:

<img src="http://host/path/bitblt-640x480/image.jpg" />

When a request comes in that matches the directive, the image is transformed and the directive is removed from the request.

However, by specifying width and height attributes in <img>-tags in served HTML documents, the middleware will do this rewriting itself.

As such, the middleware is transparent: adding it to the pipeline merely makes pages load more effectively, since images will be scaled to desired size.

Credits

Malthe Borch <mborch@gmail.com> Stefan Eletzhofer <stefan.eletzhofer@inquant.de> Jeroen Vloothuis <jeroen.vloothuis@xs4all.nl>

Changelog

0.4 (released 2008-10-11)

  • Fixed path handling. [malthe]

  • Added HTML document processing which scans document for image tags and rewrite image src attribute to include “bitblt” traversing directive. This makes it work as an actual middleware, since the application semantics are then unchanged. [malthe]

  • No longer accept query parameters, but instead require traversing directive “/bitblt-<width>x<height>”. [malthe]

  • Removed functionality to MIME-type convert. [malthe]

0.3 (released 2008-10-10)

  • Made logic robust to unexpected parameters. [malthe]

  • Fixed bug where parameters would be drawn from the WSGI environment. [malthe]

  • Added mimetype conversion. [malthe]

0.2 (released 2008-10-08)

  • Fixed entry point name.

0.1 (released 2008-10-03)

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repoze.bitblt-0.4.tar.gz (12.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page