{ "info": { "author": "Malthe Borch", "author_email": "repoze-dev@lists.repoze.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application" ], "description": "Overview\n========\n\nThis package provides a WSGI middleware component which automatically\nscales images according to the ``width`` and ``height`` property in\nthe tag.\n\nTo configure the middleware, pass in a string for ``secret``; this may\nbe any string internal to the system.\n\nYou can also set ``filter`` to select the scaling filter. The available\nfilters are ``nearest``, ``bilinear``, ``bicubic`` and ``antialias``. The\ndefault is ``antialias``.\n\nIf you want to change the compression level for JPEG images, then you can set\nthe ``quality`` option to a value between 1 (worst) and 95 (best). The default\nis 80.\n\nBy default all image URLs are rewritten. With ``limit_to_application_url``\nyou can limit the rewriting to relative URLs and absolute URLs below the\napplication URL.\n\nA minimal cache implementation is available with the ``cache``\nparameter. It should be the path to a directory where generated images\nwill be saved. This is a very simplistic approach that does not use\nany possibly related HTTP header at all: ``Last-Modified``,\n``Expires``, etc. The only way to refresh or empty the cache is to\ndelete the files. This feature is disabled by default.\n\n\nUsage\n-----\n\nThe middleware operates in two phases, on HTML documents and images\nrespectively.\n\nWhen processing HTML documents, it looks for image tags in the\ndocument soup::\n\n \n\nIn the case it finds such an image element, it rewrites the URL to\ninclude scaling information which the middleware will read when the\nimage is served through it.\n\nThe image will be proportionally scaled, so it fits into the given size. If\nyou only set one of width or height, then the image will only be limited to\nthat, but still proportionally scaled.\n\nThis effectively means that application developers needn't worry about\nimage scaling; simply put the desired size in the HTML document.\n\nNote that this middleware is protected from DoS attacks (which is\nimportant for any middleware that does significant processing) by\nsigning all URLs with an SHA digest signature.\n\n\nContributing\n------------\n\nThe development of repoze.bitblt happens at github: https://github.com/repoze/repoze.bitblt\n\n\nCredits\n-------\n\n* Malthe Borch \n* Stefan Eletzhofer \n* Jeroen Vloothuis \n* Florian Schulze \n\n\nChangelog\n---------\n\n0.9 (released 2012-10-18)\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Maintain embedded ICC Profiles in images. Requires PIL 1.1.7 or later.\n\n- Add simplistic cache implementation. [damien]\n\n- Remove paragraph in readme which mentions the try_xhtml option. It's now a\n no-op. [jinty]\n\n- Use PATH_INFO directly to avoid blowing up on non UTF-8 paths.\n\n0.8 (released 2010-03-01)\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe major change in the 0.8 release was a rewrite of the tag search and\nreplace to use regexs rather than lxml. It was proving too hard to prevent lxml\nfrom mangling low quality HTML in nasty ways. The new regex based\nsearch/replace takes a lot of care to only modify what is necessary.\n\nSide effects of this change are a reduction of dependencies and theoretically\nbetter performance.\n\n- Work with unclosed tags (HTML4). [jinty]\n\n- Re-write rewrite_image_tags to use regular expressions to find/mangle img\n tags. As well aas removing the dependency on lxml this prevents a whole\n class of bugs where lxml was changing the HTML source too much, see\n http://bugs.repoze.org/issue103. Backwards compatibility for the\n 'ImageTransformationMiddleware' class was preserved by leaving the try_xhtml\n argument in place. It is now a no-op.\n [jinty]\n\n- Make sure resizing preserves GIF transparency.\n http://bugs.repoze.org/issue115\n [jinty]\n\n- Fix bug where tags with pixel (e.g. height=\"100px\") attributes,\n previously the url generated missed the regex resulting in broken images.\n [jinty]\n\n- Don't rewrite tags with percentage sizes, only the browser knows\n how big the images should be. See http://www.w3.org/TR/html4/types.html#h-6.6.\n [jinty]\n\n- Use ``unicode_body`` all over to ensure correct\n encoding. [jinty]\n\n- Fixed bug where the leading slash of an absolute URL without the\n FQDN would be wrongly removed. [damien]\n\n- Fixed bug where the quality-parameter would not be coerced to\n integer, required by PIL. [damien]\n\n- Compatibility with Python 2.4. [malthe]\n\n0.7 (released 2009-03-18)\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Don't use python 2.6 syntax.\n [seletz]\n\n- Handle empty content bodies, which can occure for redirects.\n [fschulze]\n\n- Added support for xhtml, which allows the inclusion of namespace tags.\n [fschulze]\n\n- Added option to limit the url rewriting to urls below the application url.\n [fschulze]\n\n- Added scaling filter support.\n [fschulze]\n\n- Support image tags with only one of the width or height attributes set.\n [fschulze]\n\n- Fix UnboundLocalError for respones with untransformed image.\n [fschulze]\n\n- Fix importing of PIL. The old way assumed the broken egg installation.\n [fschulze]\n\n- Made tests run.\n [fschulze]\n\n0.6 (released 2008-10-11)\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Require to pass in a ``secret`` parameter to configure middleware\n security. [malthe]\n\n0.5 (released 2008-10-11)\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Rewritten URLs are now signed by the middleware to ensure that\n bitblt requests are only crafted by the middleware. This is required\n to shield against DoS attacks. [malthe]\n\n0.4 (released 2008-10-11)\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Fixed path handling. [malthe]\n\n- Added HTML document processing which scans document for image tags\n and rewrite image ``src`` attribute to include \"bitblt\" traversing\n directive. This makes it work as an actual middleware, since the\n application semantics are then unchanged. [malthe]\n\n- No longer accept query parameters, but instead require traversing\n directive \"/bitblt-x\". [malthe]\n\n- Removed functionality to MIME-type convert. [malthe]\n\n0.3 (released 2008-10-10)\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Made logic robust to unexpected parameters. [malthe]\n\n- Fixed bug where parameters would be drawn from the WSGI environment. [malthe]\n\n- Added mimetype conversion. [malthe]\n\n0.2 (released 2008-10-08)\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Fixed entry point name.\n\n0.1 (released 2008-10-03)\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Initial release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.repoze.org", "keywords": "web middleware wsgi pil image transformation", "license": "BSD-derived (http://www.repoze.org/LICENSE.txt)", "maintainer": null, "maintainer_email": null, "name": "repoze.bitblt", "package_url": "https://pypi.org/project/repoze.bitblt/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/repoze.bitblt/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.repoze.org" }, "release_url": "https://pypi.org/project/repoze.bitblt/0.9/", "requires_dist": null, "requires_python": null, "summary": "Image transforming WSGI middleware", "version": "0.9" }, "last_serial": 642309, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "4af0ba62e181c0e463620384ca1c2b09", "sha256": "0d40db36032436a69d95d566fd94b175518c875e23322190881c9955a6b55b5d" }, "downloads": -1, "filename": "repoze.bitblt-0.1.tar.gz", "has_sig": false, "md5_digest": "4af0ba62e181c0e463620384ca1c2b09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11220, "upload_time": "2008-10-03T15:32:12", "url": "https://files.pythonhosted.org/packages/cf/88/a844494775d4b678e8f6c560523657447ed2a4411eb935a72180fa4f334d/repoze.bitblt-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "1703e6df36e0f4e0e8a7654ffc273ce7", "sha256": "fc135e3820e1eb8a0dbb62a29d3de6f88faa33083a74a7a713e5258c75782d11" }, "downloads": -1, "filename": "repoze.bitblt-0.2.tar.gz", "has_sig": false, "md5_digest": "1703e6df36e0f4e0e8a7654ffc273ce7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10679, "upload_time": "2008-10-08T19:28:53", "url": "https://files.pythonhosted.org/packages/9f/88/77fa263a611de81124d2f28789e412e96e1def2550032c32ce4ecb81b03c/repoze.bitblt-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "6b42b775f28b0ea0892800943691f1e5", "sha256": "a92b69fa67a262539b5fb377733af2132cc9f4fcc79c49842d38c75e9c8b6d9e" }, "downloads": -1, "filename": "repoze.bitblt-0.3.tar.gz", "has_sig": false, "md5_digest": "6b42b775f28b0ea0892800943691f1e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10981, "upload_time": "2008-10-10T20:00:34", "url": "https://files.pythonhosted.org/packages/f2/bf/1b9957ba28a6b933703b78fc80a7744eab6a13a270838b86108782a2e7cb/repoze.bitblt-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "bd3cce33297f26e189a26e20de00db16", "sha256": "b35c6f4f39197a7cbf1875ce60057a4e7599b65160e69887095c58e66a3e668b" }, "downloads": -1, "filename": "repoze.bitblt-0.4.tar.gz", "has_sig": false, "md5_digest": "bd3cce33297f26e189a26e20de00db16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12096, "upload_time": "2008-10-11T17:48:02", "url": "https://files.pythonhosted.org/packages/8c/d3/927cc52d47a9b9e1adf0a3c16ea4b571083ef69782eb06ad03a5246c2fa1/repoze.bitblt-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "f788ef8421653a0bd16b4c9a2c4f4ca6", "sha256": "ad82351518b2b945343b8ce1f466e7a6f0eaf80c73b3ee7b2f21b1180dbc5ab9" }, "downloads": -1, "filename": "repoze.bitblt-0.5.tar.gz", "has_sig": false, "md5_digest": "f788ef8421653a0bd16b4c9a2c4f4ca6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12419, "upload_time": "2008-10-11T21:10:35", "url": "https://files.pythonhosted.org/packages/38/3d/46974c1eec58815942ef628eb588a16b4c72537f3ce75165987d6613723d/repoze.bitblt-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "1a2aaa3661a708259175477975bd643e", "sha256": "37087fcc6eb47ecd3bbd21932b0a5c21746ed2a3a83a814006ce86b3bec1d19a" }, "downloads": -1, "filename": "repoze.bitblt-0.6.tar.gz", "has_sig": false, "md5_digest": "1a2aaa3661a708259175477975bd643e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12551, "upload_time": "2008-10-11T22:16:40", "url": "https://files.pythonhosted.org/packages/1a/d0/d8988eaf0a2b323b35e02fa6b088dfcbe1a6b6ec7d684a9010c77bac27b9/repoze.bitblt-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "17a80b3049ecea6fbffd4bdb4c5139b4", "sha256": "8b65ed26510caf1a24f6dd3af8cd555842c2f5fcc6f3602fc252b77bdc210efe" }, "downloads": -1, "filename": "repoze.bitblt-0.7.tar.gz", "has_sig": false, "md5_digest": "17a80b3049ecea6fbffd4bdb4c5139b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16482, "upload_time": "2009-03-18T12:01:42", "url": "https://files.pythonhosted.org/packages/21/9f/49706d2498888a20b6c7ee33774638b287a712eef8b2f24e829aa10d67fb/repoze.bitblt-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "9a1ec8021250928d9612e7c53b28e496", "sha256": "6b1cf80280e4befbd1062ace93fba173a90ab0f59cb8f88b1fb88f116d8b6403" }, "downloads": -1, "filename": "repoze.bitblt-0.8.tar.gz", "has_sig": false, "md5_digest": "9a1ec8021250928d9612e7c53b28e496", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22286, "upload_time": "2010-03-01T16:20:03", "url": "https://files.pythonhosted.org/packages/59/c7/70d4eae8ca23f2c58197e684b9aa3df3ac7a6bf1c6a32b57485268d00ff0/repoze.bitblt-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "db6c1cd61871c46a7f15bcffeece4305", "sha256": "6b431dce2f734987b4e526289fa6bcb9d33dc588df17c11d625834ea63342c52" }, "downloads": -1, "filename": "repoze.bitblt-0.9.tar.gz", "has_sig": false, "md5_digest": "db6c1cd61871c46a7f15bcffeece4305", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22747, "upload_time": "2012-10-18T09:32:40", "url": "https://files.pythonhosted.org/packages/5d/2d/97923d327f63b67d3be3e90670a10da74393c4f5bc837cb802a247c06501/repoze.bitblt-0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db6c1cd61871c46a7f15bcffeece4305", "sha256": "6b431dce2f734987b4e526289fa6bcb9d33dc588df17c11d625834ea63342c52" }, "downloads": -1, "filename": "repoze.bitblt-0.9.tar.gz", "has_sig": false, "md5_digest": "db6c1cd61871c46a7f15bcffeece4305", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22747, "upload_time": "2012-10-18T09:32:40", "url": "https://files.pythonhosted.org/packages/5d/2d/97923d327f63b67d3be3e90670a10da74393c4f5bc837cb802a247c06501/repoze.bitblt-0.9.tar.gz" } ] }