{ "info": { "author": "Jonathan Riboux", "author_email": "jonathan.riboux@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Plone", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.4", "Topic :: Multimedia :: Graphics :: Graphics Conversion", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Introduction\n============\n\nProvides an image field that can crop, zoom or scale an image instead of just scaling it.\nIt is fully compatible with archetype's way of defining image sizes and cropped images can be accessed the traversal way ( context/image_[size_name]).\n\nSome cropping or clipping products already exists but I don't think they are flexible enough to cover every need(Products.RichImage, Products.croppingimage, archetypes.clippingimage, ...).\n\nThis one keeps archetype's way of defining sizes and extends it to add an extra resize method parameter.\n\nMigrating from Archetype's ImageField to CroppingImageField\n===========================================================\n\nMigrating existing ImageFields is as easy as switching from ImageField to CroppingImageField class.\nIf no resize method is specified, the default resize method of Archetype is used (scale).\nOnce switched to CroppingImageField you can add a third parameter to specify which resize method to use when generating each scale (see Sample schema definition)\n\nTests and examples\n==================\n\nTests imports\n-------------\n\nOnly used for testing\n >>> import os\n >>> from Products.Archetypes.tests.utils import mkDummyInContext\n >>> from Products.Archetypes.tests.utils import Dummy\n >>> from Products.Archetypes.atapi import *\n \nThis one must be imported in the type's module\n >>> from collective.croppingimagefield import fields as cif\n\t\nSample schema definition\n------------------------\n\t\n >>> schema = BaseSchema + Schema((\n ... cif.CroppingImageField('image',\n ... original_size= (800,600,\n ... cif.RESIZE_CROP),\n ... sizes={'mini' : (80,80), # default : scale (AT original behavior)\n ... 'normal' : (200,200,\n ... cif.RESIZE_SCALE),\n ... 'big' : (300,300,\n ... cif.RESIZE_ZOOM),\n ... 'maxi' : (500,500),\n ... 'header' : (500,150,\n ... cif.RESIZE_CROP)}),\n ... ))\n\t\nSetting up testing datas\n------------------------\n\t\nCreating a dummy object using the schema\n >>> instance = mkDummyInContext(\n ... Dummy, oid='dummy',\n ... context=self.portal,\n ... schema=schema)\n \nCheck that the image has been correctly loaded in the test case\n >>> self._image[:5]\n 'GIF89'\n \nSet the image and check that it has been stored in the image field\n >>> instance.setImage(self._image, mimetype='image/gif')\n >>> instance.getImage()\n \n\nImage scales\n------------\n\nimage is 800x600 (cropped so not 600x600)\n >>> instance.image.width, instance.image.height\n (800, 600)\n\n\nThere is an image_mini scale\n >>> instance.image_mini\n \n\nIt is 80x60 (Default (SCALE) : image is resized to fit in the rectangle) \n >>> instance.image_mini.width, instance.image_mini.height\n (80, 60)\n\n\nThere is an image_normal scale\n >>> instance.image_normal\n \n\nIt is 200x150 (SCALE : image is resized to fit in the rectangle) \n >>> instance.image_normal.width, instance.image_normal.height\n (200, 150)\n\n\nThere is an image_big scale\n >>> instance.image_big\n \n\nIt is 300x300 (SCALE : image is resized so the smallest side fit in the rectangle, and image overflow is kept) \n >>> instance.image_big.width, instance.image_big.height\n (400, 300)\n\n\nThere is an image_header scale\n >>> instance.image_header\n \n\nIt is 500x150 (SCALE : image is resized so the smallest side fit in the rectangle, and image overflow is cropped) \n >>> instance.image_header.width, instance.image_header.height\n (500, 150)\n\t\nChangelog\n=========\n\n1.0 - Unreleased\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://svn.plone.org/svn/collective/collective.croppingimagefield", "keywords": "", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "collective.croppingimagefield", "package_url": "https://pypi.org/project/collective.croppingimagefield/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.croppingimagefield/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://svn.plone.org/svn/collective/collective.croppingimagefield" }, "release_url": "https://pypi.org/project/collective.croppingimagefield/0.1beta/", "requires_dist": null, "requires_python": null, "summary": "Provides an image field that can crop, zoom or scale an image instead of just scaling it", "version": "0.1beta" }, "last_serial": 787736, "releases": { "0.1beta": [ { "comment_text": "", "digests": { "md5": "545dff8b44f9e2bee028fd69299e7f65", "sha256": "6a649b0f11249d88ffd198169a0ebf7c2a05c8829816792473272972ccab9006" }, "downloads": -1, "filename": "collective.croppingimagefield-0.1beta-py2.4.egg", "has_sig": false, "md5_digest": "545dff8b44f9e2bee028fd69299e7f65", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 10147, "upload_time": "2009-07-21T03:08:38", "url": "https://files.pythonhosted.org/packages/03/e0/dc985da7f3ce1472ac5dd66a157ca6beeae8638b87ff72340fc93705a4a5/collective.croppingimagefield-0.1beta-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "12f3ea109e9dba45118210b2974e81ad", "sha256": "d39f94f5ba83053a4de53bccffe206e7248497750fb37e48537010d0ab491007" }, "downloads": -1, "filename": "collective.croppingimagefield-0.1beta.tar.gz", "has_sig": false, "md5_digest": "12f3ea109e9dba45118210b2974e81ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4596, "upload_time": "2009-07-21T03:06:46", "url": "https://files.pythonhosted.org/packages/57/e3/6ca4baa2a605f22f2c54067ec106b7bf5d1bb2a01af64cf33a2b04612499/collective.croppingimagefield-0.1beta.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "545dff8b44f9e2bee028fd69299e7f65", "sha256": "6a649b0f11249d88ffd198169a0ebf7c2a05c8829816792473272972ccab9006" }, "downloads": -1, "filename": "collective.croppingimagefield-0.1beta-py2.4.egg", "has_sig": false, "md5_digest": "545dff8b44f9e2bee028fd69299e7f65", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 10147, "upload_time": "2009-07-21T03:08:38", "url": "https://files.pythonhosted.org/packages/03/e0/dc985da7f3ce1472ac5dd66a157ca6beeae8638b87ff72340fc93705a4a5/collective.croppingimagefield-0.1beta-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "12f3ea109e9dba45118210b2974e81ad", "sha256": "d39f94f5ba83053a4de53bccffe206e7248497750fb37e48537010d0ab491007" }, "downloads": -1, "filename": "collective.croppingimagefield-0.1beta.tar.gz", "has_sig": false, "md5_digest": "12f3ea109e9dba45118210b2974e81ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4596, "upload_time": "2009-07-21T03:06:46", "url": "https://files.pythonhosted.org/packages/57/e3/6ca4baa2a605f22f2c54067ec106b7bf5d1bb2a01af64cf33a2b04612499/collective.croppingimagefield-0.1beta.tar.gz" } ] }