{ "info": { "author": "Alex Seitsinger", "author_email": "alexseitsinger@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Utilities" ], "description": "# Resize and Crop\n\n## Description\n\nResize and crop an image to fit the specified size.\n\n## Installation\n\n```python\npip install resize-and-crop\n```\n\nor\n\n```python\npipenv install resize-and-crop\n```\n\n## Methods\n\n1. resize_and_crop(path, size, crop_origin) - Resize the image located at path, into the size specified, cropping the image starting at the crop_origin.\n2. resized_image_file(image_field, format, dimensions, crop_origin) - Returns a new image file that has the resized image. Can be used to save to a Django ImageField.\n\n## Usage\n\n```python\nfrom resize_and_crop import resize_and_crop\n\nimage = resize_and_crop(\"/path/to/image\", (200,200), \"middle\")\n```\n\n```python\nfrom django.db import models\nfrom resize_and_crop.utils import resized_image_file\n\nclass ExampleModel(models.Model):\n\timage = models.ImageField(upload_to=\"images/\")\n\tthumbnail = models.ImageField(upload_to=\"thumbnails/\")\n\n\tdef save(self, *args, **kwargs):\n\t\tif self.image and not self.thumbnail:\n\t\t\tself.thumbnail = resized_image_file(\n\t\t\t\tself.image,\n\t\t\t\t\"jpeg\",\n\t\t\t\t(200, 200),\n\t\t\t)\n\t\treturn super().save(*args, **kwargs)\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alexseitsinger/resize_and_crop", "keywords": "", "license": "BSD 2-Clause License", "maintainer": "", "maintainer_email": "", "name": "resize-and-crop", "package_url": "https://pypi.org/project/resize-and-crop/", "platform": "", "project_url": "https://pypi.org/project/resize-and-crop/", "project_urls": { "Homepage": "https://github.com/alexseitsinger/resize_and_crop" }, "release_url": "https://pypi.org/project/resize-and-crop/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Resize and crop an image to fit the specified size.", "version": "0.1.1" }, "last_serial": 4365926, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "dc3f419044d8164fd2580ae236a88f8f", "sha256": "83756f15a83e4b451192f0878068cbfb6c4d087e02ca66ee0e9045c2b3ab1df9" }, "downloads": -1, "filename": "resize_and_crop-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dc3f419044d8164fd2580ae236a88f8f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2728, "upload_time": "2018-07-21T18:52:18", "url": "https://files.pythonhosted.org/packages/43/79/22efb59299947888510b07a0fd94cd2a5b0d7477a795678db26693d94463/resize_and_crop-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e613a74be6fea839cfb612cfcb7ad633", "sha256": "51cd94333e1059707e32a652fdcb9ea6b3dcb32c8af95651ac898640c69c222b" }, "downloads": -1, "filename": "resize_and_crop-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e613a74be6fea839cfb612cfcb7ad633", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6160, "upload_time": "2018-07-21T18:52:19", "url": "https://files.pythonhosted.org/packages/67/1e/8a87886cca50924445e0176ccb87a2337e3e5daad1ddaab326906aa5b1ee/resize_and_crop-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8a59b06ca9393df1cd53051ad631580a", "sha256": "c1f29aa8a8e3c600a4fa6049d9270d0c9362dc931f0805875d1137f448073094" }, "downloads": -1, "filename": "resize_and_crop-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8a59b06ca9393df1cd53051ad631580a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3611, "upload_time": "2018-10-11T21:00:51", "url": "https://files.pythonhosted.org/packages/75/86/3a32a1d82df507b4f9357fc46bd4eb87b17f8b0c50e54ce12bbbd77365b9/resize_and_crop-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3e13abf53b012966f46c930184d71936", "sha256": "1335fc571d79bf15196cf2149152f6fbdadd97a400ba849d3ffa183926a18cc6" }, "downloads": -1, "filename": "resize_and_crop-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3e13abf53b012966f46c930184d71936", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6849, "upload_time": "2018-10-11T21:00:52", "url": "https://files.pythonhosted.org/packages/41/bd/35bddd185197d7e4666c4263424532326a4eaaa9b3d267f2169573b4b535/resize_and_crop-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8a59b06ca9393df1cd53051ad631580a", "sha256": "c1f29aa8a8e3c600a4fa6049d9270d0c9362dc931f0805875d1137f448073094" }, "downloads": -1, "filename": "resize_and_crop-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8a59b06ca9393df1cd53051ad631580a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3611, "upload_time": "2018-10-11T21:00:51", "url": "https://files.pythonhosted.org/packages/75/86/3a32a1d82df507b4f9357fc46bd4eb87b17f8b0c50e54ce12bbbd77365b9/resize_and_crop-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3e13abf53b012966f46c930184d71936", "sha256": "1335fc571d79bf15196cf2149152f6fbdadd97a400ba849d3ffa183926a18cc6" }, "downloads": -1, "filename": "resize_and_crop-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3e13abf53b012966f46c930184d71936", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6849, "upload_time": "2018-10-11T21:00:52", "url": "https://files.pythonhosted.org/packages/41/bd/35bddd185197d7e4666c4263424532326a4eaaa9b3d267f2169573b4b535/resize_and_crop-0.1.1.tar.gz" } ] }