{ "info": { "author": "Alen Mujezinovic", "author_email": "alen@caffeinehit.com", "bugtrack_url": null, "classifiers": [], "description": "django-croppy |image0|\n======================\n\n``django-croppy`` enables creating custom crops of images by specifying\na name, coordinates, width and height of the crop.\n\n``django-croppy`` provides a custom model field responsible for creating\nand deleting crops. Crops are stored as serialized JSON data on the same\nmodel as the image field via\n`django-jsonfield `_.\n\n``django-croppy`` is useful if you want to manually curate the crop size\nand location instead of relying on generic cropping like\n`django-imagekit `_\nprovides.\n\n``django-croppy`` makes use of image processors provided by\n``django-imagekit``.\n\nUsage\n-----\n\nFirst, create your model with a crop field. You can specify a custom\nlocation where to save crops to with the ``upload_to`` parameter:\n\n::\n\n from django.db import models\n from croppy.fields import CropField\n\n def upload_to(instance, filename, crop_name):\n \"\"\"\n Default function to specify a location to save crops to.\n\n :param instance: The model instance this crop field belongs to.\n :param filename: The image's filename this crop field operates on.\n :param crop_name: The crop name used when :attr:`CropFieldDescriptor.crop` was \n called.\n \"\"\"\n filename, ext = os.path.splitext(os.path.split(filename)[-1])\n return os.path.join('crops', u'%s-%s%s' % (filename, crop_name, ext))\n\n class Image(models.Model):\n image = models.ImageField()\n crops = CropField('image', upload_to = upload_to)\n\nThe created ``crops`` field allows you to create, delete and inspect\ncrops.\n\n::\n\n $ git clone git@github.com:caffeinehit/django-croppy.git\n $ cd django-croppy\n $ python manage.py syncdb\n ...\n $ python manage.py shell\n ...\n >>> from tests.app import tests\n >>> image = tests.get_image('test.tiff')\n >>> image\n \n >>> image.image\n \n >>> image.image.path\n u'/home/alen/projects/django-croppy/tests/test-media/images/test.tiff'\n\n >>> # Inspect the crop data\n >>> image.crops.data\n {}\n\n >>> # Create a new crop called 'rect' at position 0/0\n >>> # with a width of 100px and a height of 50px\n >>> image.crops.create('rect', (0, 0, 100, 50))\n\n >>> # Inspect the crop data\n >>> image.crops.data\n {'rect': {'y': 0, 'width': 100, 'height': 50, 'filename': 'crops/test-rect.tiff', 'x': 0}}\n\n >>> # Inspect the crop\n >>> image.crops.rect.name\n 'crops/test-rect.tiff'\n >>> image.crops.rect.path\n u'/home/alen/projects/django-croppy/tests/test-media/crops/test-rect.tiff'\n >>> image.crops.rect.url\n '/test-media/crops/test-rect.tiff'\n\n >>> # Save the data to database \n >>> image.save()\n\n >>> # Delete the crop\n >>> image.crops.delete('rect')\n >>> image.crops.data\n {}\n\n.. |image0| image:: https://api.travis-ci.org/caffeinehit/django-croppy.png", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/caffeinehit/django-croppy", "keywords": null, "license": "Copyright (c) 2012, Caffeinehit Ltd.\nCopyright (c) 2012, Alen Mujezinovic \n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "django-croppy", "package_url": "https://pypi.org/project/django-croppy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-croppy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/caffeinehit/django-croppy" }, "release_url": "https://pypi.org/project/django-croppy/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Django model field to store custom image crops", "version": "0.1.0" }, "last_serial": 789396, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d4733d7b7ff646dd8698c226a9c06389", "sha256": "4f1fb06c90a48c14b6bb08095e26f7270b6db8116718a703318b8c082b780dfb" }, "downloads": -1, "filename": "django-croppy-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d4733d7b7ff646dd8698c226a9c06389", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7055, "upload_time": "2013-01-11T16:27:21", "url": "https://files.pythonhosted.org/packages/78/de/09cefc74131449865629fdd43602a01162c3ea415f4d74c9d4984e1de6b1/django-croppy-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "a99ea7f328c0ddd8eceaf3100f392aef", "sha256": "e268e01a0936c988c24d68b15d4583ab5e7624662d78ba6c2e4728ebffdea6e4" }, "downloads": -1, "filename": "django-croppy-0.0.2.tar.gz", "has_sig": false, "md5_digest": "a99ea7f328c0ddd8eceaf3100f392aef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7102, "upload_time": "2013-01-14T14:38:49", "url": "https://files.pythonhosted.org/packages/52/b4/bfec214ed9d796200e96eb869990cf2a46aabdef131861215c13d520f12d/django-croppy-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "332823a3d003c739bda7718bd55e7aa7", "sha256": "7cf406d52153c1f7b592e416891c7f20db93000019da84e117ed665be2e0bf60" }, "downloads": -1, "filename": "django-croppy-0.0.3.tar.gz", "has_sig": false, "md5_digest": "332823a3d003c739bda7718bd55e7aa7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7226, "upload_time": "2013-01-14T15:32:16", "url": "https://files.pythonhosted.org/packages/5d/17/8501a342564cc7e1a24f893c770a95184cfdf16b6b15315b49e0da74a32a/django-croppy-0.0.3.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "0811c86dfce7ab9babd97b1cb7f71e83", "sha256": "3e7cbad27c13ddf11f300a5a0eda4a9bedf30633f58fe60f9c165ea2084d0d3f" }, "downloads": -1, "filename": "django-croppy-0.0.5.tar.gz", "has_sig": false, "md5_digest": "0811c86dfce7ab9babd97b1cb7f71e83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7812, "upload_time": "2013-01-16T17:45:02", "url": "https://files.pythonhosted.org/packages/99/12/60c5b3da8f5643e3966d07d6724b3e989f2429f2dab0382d377105f53fc6/django-croppy-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "c3ea413be53683443be1486050cf3f64", "sha256": "eac61c88e8689bca68a4141ad77f25389c22ae91deff2544445a72abcaf0e7ee" }, "downloads": -1, "filename": "django-croppy-0.0.6.tar.gz", "has_sig": false, "md5_digest": "c3ea413be53683443be1486050cf3f64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7917, "upload_time": "2013-01-17T12:33:10", "url": "https://files.pythonhosted.org/packages/da/db/dedd7ae3db971e0af1f7f2f1a159ffb9f7b0f4002f9682aa8357a9739dcf/django-croppy-0.0.6.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "e3e551fe56e2049d87c079b6666b7c41", "sha256": "912d1b1b51a0de4c5e1563233ca5af2e967369dbf50b06f9b2d56bc147f4fd73" }, "downloads": -1, "filename": "django-croppy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e3e551fe56e2049d87c079b6666b7c41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6388, "upload_time": "2013-01-24T13:55:34", "url": "https://files.pythonhosted.org/packages/f8/e0/d7d5b7d490bf786234bd032d64aa500ede1a37f0576c210775a642a4ed86/django-croppy-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e3e551fe56e2049d87c079b6666b7c41", "sha256": "912d1b1b51a0de4c5e1563233ca5af2e967369dbf50b06f9b2d56bc147f4fd73" }, "downloads": -1, "filename": "django-croppy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e3e551fe56e2049d87c079b6666b7c41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6388, "upload_time": "2013-01-24T13:55:34", "url": "https://files.pythonhosted.org/packages/f8/e0/d7d5b7d490bf786234bd032d64aa500ede1a37f0576c210775a642a4ed86/django-croppy-0.1.0.tar.gz" } ] }