{ "info": { "author": "Ravi Raja Merugu", "author_email": "rrmerugu@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "\n# django-thumbs\n\nCreate thumbnails for your images with Django.\n\n## Fork\n\nForked from .\n\n## Features\n\n* Easy to integrate in your code (no database changes, works as an `ImageField`)\n* Works with any storage backend\n* Generates thumbnails after image is uploaded into memory\n* Deletes thumbnails when the image file is deleted\n* Provides easy access to the thumbnails' URLs (similar method as with `ImageField`)\n\n## Example\n\n from django.db import models\n from django_thumbs.fields import ImageThumbsField\n\n class Person(models.Model):\n\n SIZES = (\n {'code': 'avatar', 'wxh': '125x125', 'resize': 'crop'},\n {'code': 'm', 'wxh': '640x480', 'resize': 'scale'},\n {'code': '150', 'wxh': '150x150'}, # 'resize' defaults to 'scale'\n )\n photo = ImageThumbsField(upload_to='images', sizes=SIZES)\n\nThe field `photo` has a `sizes` attribute specifying desired sizes for the thumbnails. This field works the same way as `ImageField` but it also creates the desired thumbnails when uploading a new file and deletes the thumbnails when deleting the file.\n\nWith `ImageThumbsField` you retrieve the URL for every thumbnail specifying its size code. In this example we use `someone.photo.url_avatar`, `someone.photo.url_150` or `someone.photo.url_m` to get the thumbnail URL.\n\n## Install\n\nInstall django-thumbs into a virtualenv using pip:\n\n (env)$ pip install git+https://github.com/rrmerugu/django-thumbs-v2.git#egg=django-thumbs-v2\n\nAdd `thumbs` to your installed apps:\n\n INSTALLED_APPS = (\n # ...\n 'django_thumbs',\n )\n\n## Usage\n\n* Import it in your `models.py` and replace `ImageField` with `ImageThumbsField` in your model\n* Add a `sizes` attribute with a list of sizes you want to use for the thumbnails\n* Make sure you have defined `STATIC_URL` in your settings.py\n\n## Sizes\n\nEach size is a dictionary that defines a thumbnail. For example,\n\n SIZES = (\n {'code': 'avatar', 'wxh': '125x125', 'resize': 'crop'},\n {'code': 'm', 'wxh': '640x480', 'resize': 'scale'},\n {'code': 'flatrow', 'wxh': 'x120'},\n {'code': '150', 'wxh': '150x150'}, # 'resize' defaults to 'scale'\n )\n\nSize validation errors will raise `SizeError`.\n\n### code (required)\n\nmatches re: `RE_CODE`\n\n`code` is the size name. It appears in the thumb filename separated by `THUMBS_DELIMITER`. For example, `'original.jpg'` becomes `'original-small.jpg'` for the default delimiter `'-'` and code `'small'`.\n\n### wxh (required)\n\nmatches re: `RE_WXH`\n\n`wxh` is the width x height as a string.\n\nFixed width images are supported with `240x`. The thumbnail will be scaled\ndown *or up* to a 240 pixel width. Fixed height images are similarly\nsupported with `90x`.\n\n### resize (optional)\n\ndefault: `'scale'`\noptions: `'scale'` or `'crop'`\n\n`resize` determines how the image will be resized.\n\n`'scale'` resizes the thumb to `wxh`. For example, a 2000 x 1000 image will become 500 x 250 for `'scale'` and a `wxh` of `'500x500'`. `'scale'` does not enlarge a photo. A 200 x 100 image will remain 200 x 100 for `'scale'` and `wxh` of `'500x500'`. `'scale'` does not crop.\n\n`'crop'` crops and centers the image fit `wxh` exactly. For example, a 2000 x 1000 image will become 500 x 500 for `'crop'` and a `wxh` of `'500x500'`. `'crop'` will enlarge a photo to exactly fit `wxh`. A 200 x 100 image will enlarge and crop to 500 x 500 for `'crop'` and `wxh` of `'500x500'`.\n\n## Settings\n\n`django-thumbs` will use default settings unless these settings are found in Django settings.\n\n### THUMBS_DELIMITER\n\ndefault: `'-'`\n\n`THUMBS_DELIMITER` sets the delimiter between the original image base name and the thumb size `code`. For example, `'original.jpg'` becomes `'original-small.jpg'` for the default delimiter `'-'` and code `'small'`.\n\n### THUMBS_JPG\n\ndefault: `False`\n\nSet `THUMBS_JPG` to `True` to force all thumbnails to `.jpg` format and file extension regardless of original image format or file extension.\n\n### THUMBS_QUALITY\n\ndefault: `75`\n\n`THUMBS_QUALITY` sets PIL quality. See \n\n### THUMBS_OPTIMIZE\n\ndefault: `True`\n\n`THUMBS_OPTIMIZE` sets PIL optimize option on JPG or PNG images.\n\n### THUMBS_PROGRESSIVE\n\ndefault: `False`\n\n`THUMBS_PROGRESSIVE` sets PIL progressive option on JPG images.\n\n### THUMBS_AUTOROTATE\n\ndefault: `True`\n\n`THUMBS_AUTOROTATE` rotates thumbnails based on original EXIF data, if any.\n\n## PublicS3BotoStorage\n\n`PublicS3BotoStorage` generates clean URLs for Amazon S3 in code--without calling Amazon and without S3 querystring auth and expires. Hooray! URLs are `'public-read'`.\n\n`PublicS3BotoStorage` is based on `S3BotoStorage_AllPublic` from .\n\nAdd to `requirements.txt`:\n\n django-storages==1.1.4\n boto==2.5.2\n\nIn Django settings, instead of\n\n DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'\n\nuse `PublicS3BotoStorage`:\n\n DEFAULT_FILE_STORAGE = 'django_thumbs.backends.PublicS3BotoStorage'\n\n`PublicS3BotoStorage` looks for `AWS_S3_SECURE_URLS` and `AWS_S3_CUSTOM_DOMAIN` settings. `AWS_S3_SECURE_URLS` sets `https` or `http`. `AWS_S3_CUSTOM_DOMAIN` sets custom domain or `s3.amazonaws.com`.\n\n## Uninstall\n\nAt any time you can go back and use `ImageField` again without altering the database or anything else. Just replace `ImageThumbsField` with `ImageField` again and make sure you delete the `sizes` attribute. Everything will work the same way it worked before using django-thumbs. Just remember to delete generated thumbnails in the case you don't want to have them anymore.\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rrmerugu/django-thumbs", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-thumbs-v2", "package_url": "https://pypi.org/project/django-thumbs-v2/", "platform": "", "project_url": "https://pypi.org/project/django-thumbs-v2/", "project_urls": { "Homepage": "https://github.com/rrmerugu/django-thumbs" }, "release_url": "https://pypi.org/project/django-thumbs-v2/0.4.1/", "requires_dist": null, "requires_python": "", "summary": "The easiest way to create thumbnails for your images with Django. Works with any storage backend.", "version": "0.4.1" }, "last_serial": 3680373, "releases": { "0.4.1": [ { "comment_text": "", "digests": { "md5": "8cef3ac14f182683cb5be7582ca822b3", "sha256": "8dd8c9a0fa29c75f7745a0a85e304ebac98cf93d3daa510d742d9fcd88f62394" }, "downloads": -1, "filename": "django_thumbs_v2-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8cef3ac14f182683cb5be7582ca822b3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11743, "upload_time": "2018-03-18T06:43:29", "url": "https://files.pythonhosted.org/packages/62/04/4e09051e676cbdf4da38b8808386a994a40a446fafc11ad8f501bdcdfc34/django_thumbs_v2-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4400f06ceeaa91903a2136907d69f0a1", "sha256": "9a36e1214bef67b76f916964c5bcc92961faa8b42cb2756327c2b697c754cbae" }, "downloads": -1, "filename": "django_thumbs_v2-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4400f06ceeaa91903a2136907d69f0a1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11735, "upload_time": "2018-03-18T06:43:31", "url": "https://files.pythonhosted.org/packages/00/09/22ea82cadba9719dc613721ea05387995bb371e99e6117aa17d49ba7d6ad/django_thumbs_v2-0.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6d9d8cde6446510875ff2c723d5f6a8c", "sha256": "c5395c2b66b7db2794c4e87dee7a0c540663775eeaa85f6f3712d57a4efbf603" }, "downloads": -1, "filename": "django-thumbs-v2-0.4.1.tar.gz", "has_sig": false, "md5_digest": "6d9d8cde6446510875ff2c723d5f6a8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7926, "upload_time": "2018-03-18T06:43:32", "url": "https://files.pythonhosted.org/packages/4f/0a/ddb9f30542a2c6a4dae4012fbf06add36eea08ce5d5e23d3c760efdb6c1a/django-thumbs-v2-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8cef3ac14f182683cb5be7582ca822b3", "sha256": "8dd8c9a0fa29c75f7745a0a85e304ebac98cf93d3daa510d742d9fcd88f62394" }, "downloads": -1, "filename": "django_thumbs_v2-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8cef3ac14f182683cb5be7582ca822b3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11743, "upload_time": "2018-03-18T06:43:29", "url": "https://files.pythonhosted.org/packages/62/04/4e09051e676cbdf4da38b8808386a994a40a446fafc11ad8f501bdcdfc34/django_thumbs_v2-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4400f06ceeaa91903a2136907d69f0a1", "sha256": "9a36e1214bef67b76f916964c5bcc92961faa8b42cb2756327c2b697c754cbae" }, "downloads": -1, "filename": "django_thumbs_v2-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4400f06ceeaa91903a2136907d69f0a1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11735, "upload_time": "2018-03-18T06:43:31", "url": "https://files.pythonhosted.org/packages/00/09/22ea82cadba9719dc613721ea05387995bb371e99e6117aa17d49ba7d6ad/django_thumbs_v2-0.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6d9d8cde6446510875ff2c723d5f6a8c", "sha256": "c5395c2b66b7db2794c4e87dee7a0c540663775eeaa85f6f3712d57a4efbf603" }, "downloads": -1, "filename": "django-thumbs-v2-0.4.1.tar.gz", "has_sig": false, "md5_digest": "6d9d8cde6446510875ff2c723d5f6a8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7926, "upload_time": "2018-03-18T06:43:32", "url": "https://files.pythonhosted.org/packages/4f/0a/ddb9f30542a2c6a4dae4012fbf06add36eea08ce5d5e23d3c760efdb6c1a/django-thumbs-v2-0.4.1.tar.gz" } ] }