{ "info": { "author": "keul", "author_email": "luca@keul.it", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Plone", "Framework :: Plone :: 4.0", "Framework :: Plone :: 4.1", "Framework :: Plone :: 4.2", "Programming Language :: Python" ], "description": ".. contents:: **Table of contents**\r\n\r\nIntroduction\r\n============\r\n\r\nThis Plone add-on perform (lossless) optimization image content types, using external processes.\r\n\r\n.. Note::\r\n This software is in **alpha version**. Using this in a production site can hurt your performance.\r\n \r\n Read documentation *carefully*.\r\n\r\nHow it works\r\n============\r\n\r\nYour site users will continue to load image contents normally, but the data loaded will be taken from\r\nexternal optimization software (that must live on the server) for executing\r\n**image lossless transformation**.\r\n\r\nIn this way the final result will be commonly an smaller image, loaded quickly by browsers.\r\n\r\nBy default adding this plugin is not enough. You must include all supported software you have installed\r\non you server (or limiting it to what you want to use).\r\n\r\nTo do this, include a proper zcml file in your buildout configuration::\r\n\r\n [instance]\r\n ...\r\n\teggs =\r\n\t Plone\r\n\t ...\r\n\t collective.optimage\r\n\t\r\n\tzcml =\r\n\t ...\r\n\t collective.optimage:wantedoptimizator1.zcml\r\n\t collective.optimage:wantedoptimizator2.zcml\r\n\t ...\r\n\r\nAll *wantedoptimizatorX* entries must be one of the supported software below.\r\nAn example::\r\n\r\n\tzcml =\r\n\t collective.optimage:jpegoptim.zcml\r\n\t collective.optimage:optipng.zcml\r\n\r\nTo include them all (excluded pngout), just include the \"*all.zcml*\".\r\n\r\nSupported software\r\n------------------\r\n\r\nRight now this product supports those command line tools:\r\n\r\n``jpegoptim``\r\n For JPEG optimization - http://freecode.com/projects/jpegoptim\r\n``jpegtran``\r\n For JPEG optimization - http://jpegclub.org/jpegtran/\r\n``gifscicle``\r\n For GIT optimization - http://www.lcdf.org/gifsicle/\r\n``optipng``\r\n For PNG optimization - http://optipng.sourceforge.net/\r\n``pngcrush``\r\n For PNG optimization - http://pmt.sourceforge.net/pngcrush/\r\n``pngout`` (*slow*)\r\n For PNG optimization- http://advsys.net/ken/util/pngout.htm\r\n\r\nAdding your own\r\n---------------\r\n\r\nIf you like to provide support for additional software, you can do it using ZCA in your own products.\r\nYou need to provide a named adapter for the `IOptimageProvider interface`__.\r\n\r\n__ https://github.com/keul/collective.optimage/blob/master/collective/optimage/interfaces.py#L5\r\n\r\nAn example::\r\n\r\n \r\n\r\nFinally, your adapter class will be something like this::\r\n\r\n from zope.interface import implements\r\n from collective.optimage.interfaces import IOptimageProvider\r\n\r\n class YourSoftwareAdapter(object):\r\n \"\"\"Optimize using yournewsoftware\"\"\"\r\n implements(IOptimageProvider)\r\n \r\n for_image = 'jpeg'\r\n\r\n def optimize(self):\r\n // do stuff, calling external process\r\n\r\nNote that you must fill the ``for_image`` providing the image type you want to threat with your plugin.\r\n\r\nTips and know issues\r\n====================\r\n\r\nCommand line tool position\r\n--------------------------\r\n\r\nRight now this product will try to run all of the software given above simply calling them.\r\nIf the program is not available at the user that run Zope process you could like to manually specify where\r\nis it.\r\nThe same if the software has been manually installed (for example: if you manually downloaded\r\nand installed it inside a buildout installation and not system wide).\r\n\r\nTo do this, provide a environment var called \"*SOFTWARENAME*\\_PATH\". An example::\r\n\r\n [instance]\r\n \r\n ...\r\n \r\n environment-vars =\r\n ...\r\n JPEGOPTIM_PATH /opt/local/bin/jpegoptim\r\n\r\nContent types\r\n-------------\r\n\r\nRight now Plone Image content type is the only one supported. Unluckily Plone News item is still not using\r\nZope BLOB support so it will not gain any optimization.\r\n\r\nPerformance\r\n-----------\r\n\r\nOperations done by external processes are synchronous, so **blocking the Zope thread**.\r\nThis will lower your site performance when an editor is providing new images\r\n(or modifying existings ones).\r\n\r\nYou can make them quicker (but less efficient), playing with configuration options.\r\n\r\nOn performance (again)\r\n----------------------\r\n\r\nRight now optimization are done *after* the image has been loaded on Plone. An event is fired after\r\nthe image source change, then the image is put on a temp file and then processed.\r\nAfter that the optimized image is loaded again.\r\n\r\nThis is also done for all scaled image versions.\r\n\r\nThis is inefficient, so probably will change in future, however is the only way I found without monkey-patch\r\nPlone.\r\n\r\nChangelog\r\n=========\r\n\r\n0.1.0 (2012-06-30)\r\n------------------\r\n\r\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://plone.org/products/collective.optimage", "keywords": "plone image optimization web jpegoptim optipng", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "collective.optimage", "package_url": "https://pypi.org/project/collective.optimage/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.optimage/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://plone.org/products/collective.optimage" }, "release_url": "https://pypi.org/project/collective.optimage/0.1.0a/", "requires_dist": null, "requires_python": null, "summary": "Optimize Plone content images for Web usage", "version": "0.1.0a" }, "last_serial": 2040369, "releases": { "0.1.0a": [ { "comment_text": "", "digests": { "md5": "02c490b7dd6c7276f390665779c16bce", "sha256": "73b091df053b53118df0632daa8e180deb1d6d5bae25ecd39b0478c034fccc2c" }, "downloads": -1, "filename": "collective.optimage-0.1.0a.zip", "has_sig": false, "md5_digest": "02c490b7dd6c7276f390665779c16bce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28331, "upload_time": "2012-06-30T18:43:58", "url": "https://files.pythonhosted.org/packages/92/fc/6e2d505ec65927118fe4f3627d621c9f2109f6c4f7ec46de68cbfbe8d7b7/collective.optimage-0.1.0a.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "02c490b7dd6c7276f390665779c16bce", "sha256": "73b091df053b53118df0632daa8e180deb1d6d5bae25ecd39b0478c034fccc2c" }, "downloads": -1, "filename": "collective.optimage-0.1.0a.zip", "has_sig": false, "md5_digest": "02c490b7dd6c7276f390665779c16bce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28331, "upload_time": "2012-06-30T18:43:58", "url": "https://files.pythonhosted.org/packages/92/fc/6e2d505ec65927118fe4f3627d621c9f2109f6c4f7ec46de68cbfbe8d7b7/collective.optimage-0.1.0a.zip" } ] }