{"id":13415694,"url":"https://github.com/jazzband/sorl-thumbnail","last_synced_at":"2025-12-11T21:04:32.487Z","repository":{"id":37734636,"uuid":"1073323","full_name":"jazzband/sorl-thumbnail","owner":"jazzband","description":"Thumbnails for Django","archived":false,"fork":false,"pushed_at":"2025-05-05T17:21:16.000Z","size":2123,"stargazers_count":1768,"open_issues_count":122,"forks_count":496,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-05-11T11:12:01.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sorl-thumbnail.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jazzband.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://jazzband.co/donate"]}},"created_at":"2010-11-12T00:46:35.000Z","updated_at":"2025-05-09T21:48:30.000Z","dependencies_parsed_at":"2024-01-11T19:15:18.652Z","dependency_job_id":"b0173c44-2ff8-4b43-84a8-7d90e237e456","html_url":"https://github.com/jazzband/sorl-thumbnail","commit_stats":{"total_commits":797,"total_committers":157,"mean_commits":5.076433121019108,"dds":0.7252195734002509,"last_synced_commit":"4e77896c93661a12bbe369d35da2bc4048b80692"},"previous_names":["mariocesar/sorl-thumbnail"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzband%2Fsorl-thumbnail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzband%2Fsorl-thumbnail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzband%2Fsorl-thumbnail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzband%2Fsorl-thumbnail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jazzband","download_url":"https://codeload.github.com/jazzband/sorl-thumbnail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253554090,"owners_count":21926614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T21:00:51.397Z","updated_at":"2025-12-11T21:04:32.479Z","avatar_url":"https://github.com/jazzband.png","language":"Python","funding_links":["https://jazzband.co/donate"],"categories":["Third-Party Packages","Python","Django Utilities"],"sub_categories":["Files/Images"],"readme":"|jazzband-badge| |pypi| |python-badge| |django-badge| |docs| |gh-actions| |codecov|\n\nThumbnails for Django.\n\nFeatures at a glance\n====================\n\n- Support for Django 4.2, 5.0, 5.1, and 5.2 following the `Django supported versions policy`_\n- Storage support\n- Pluggable Engine support for `Pillow`_, `ImageMagick`_, `PIL`_, `Wand`_, `pgmagick`_, and `vipsthumbnail`_\n- Pluggable Key Value Store support (cached db, redis, and dynamodb by AWS)\n- Pluggable Backend support\n- Admin integration with possibility to delete\n- Dummy generation (placeholders)\n- Flexible, simple syntax, generates no html\n- ImageField for model that deletes thumbnails (only compatible with django 1.2.5 or less)\n- CSS style cropping options\n- Back smart cropping, and remove borders from the images when cropping\n- Margin calculation for vertical positioning\n- Alternative resolutions versions of a thumbnail\n\nRead more in `the documentation (latest version) \u003chttps://sorl-thumbnail.readthedocs.io/\u003e`_\n\nDevelopers\n==========\n\n|jazzband|\n\nThis is a `Jazzband \u003chttps://jazzband.co\u003e`_ project. By contributing you agree to\nabide by the `Contributor Code of Conduct \u003chttps://jazzband.co/about/conduct\u003e`_\nand follow the `guidelines \u003chttps://jazzband.co/about/guidelines\u003e`_.\n\nFeel free to create a new Pull request if you want to propose a new feature.\nIf you need development support or want to discuss with other developers\njoin us in the channel #sorl-thumbnail at freenode.net or Gitter.\n\nFor releases updates and more in deep development discussion use our mailing list\nin Google Groups.\n\n- IRC Channel: irc://irc.freenode.net/#sorl-thumbnail\n\n- Mailing List: sorl-thumbnail@googlegroups.com https://groups.google.com/d/forum/sorl-thumbnail\n\nTests\n-----\nThe tests should run with tox. Running `tox` will run all tests for all environments.\nHowever, it is possible to run a certain environment with `tox -e \u003cenv\u003e`, a list of all environments\ncan be found with `tox -l`. These tests require the dependencies of the different engines defined in\nthe documentation. The easiest way to run tests is using Docker - see the `contributing documentation \u003chttps://sorl-thumbnail.readthedocs.io/en/latest/contributing.html#running-testsuite\u003e`_\nfor detailed instructions on running tests locally with Docker.\n\nUser Support\n============\n\nIf you need help using sorl-thumbnail browse https://stackoverflow.com/questions/tagged/sorl-thumbnail\nand posts your questions with the `sorl-thumbnail` tag.\n\n\nHow to Use\n==========\n\nGet the code\n------------\n\nGetting the code for the latest stable release use 'pip'. ::\n\n   $ pip install sorl-thumbnail\n\nInstall in your project\n-----------------------\n\nThen register 'sorl.thumbnail', in the 'INSTALLED_APPS' section of\nyour project's settings. ::\n\n    INSTALLED_APPS = [\n        'django.contrib.admin',\n        'django.contrib.auth',\n        'django.contrib.contenttypes',\n        'django.contrib.sessions',\n        'django.contrib.messages',\n        'django.contrib.staticfiles',\n\n        'sorl.thumbnail',\n    ]\n\n\nTemplates Usage\n---------------\n\nAll of the examples assume that you first load the thumbnail template tag in\nyour template.::\n\n    {% load thumbnail %}\n\n\nA simple usage. ::\n\n    {% thumbnail item.image \"100x100\" crop=\"center\" as im %}\n        \u003cimg src=\"{{ im.url }}\" width=\"{{ im.width }}\" height=\"{{ im.height }}\"\u003e\n    {% endthumbnail %}\n\nSee more examples in the section `Template examples`_ in the Documentation\n\nModel Usage\n-----------\n\nUsing the ImageField that automatically deletes references to itself in the key\nvalue store and its thumbnail references and the thumbnail files when deleted.\nPlease note that this is only compatible with django 1.2.5 or less.::\n\n    from django.db import models\n    from sorl.thumbnail import ImageField\n\n    class Item(models.Model):\n        image = ImageField(upload_to='whatever')\n\nSee more examples in the section `Model examples`_ in the Documentation\n\nLow level API\n-------------\n\nYou can use the 'get_thumbnail'::\n\n    from sorl.thumbnail import get_thumbnail\n    from sorl.thumbnail import delete\n\n    im = get_thumbnail(my_file, '100x100', crop='center', quality=99)\n    delete(my_file)\n\nSee more examples in the section `Low level API examples`_ in the Documentation\n\nUsing in combination with other thumbnailers\n--------------------------------------------\n\nAlternatively, you load the templatetags by {% load sorl_thumbnail %}\ninstead of traditional {% load thumbnail %}. It's especially useful in\nprojects that do make use of multiple thumbnailer libraries that use the\nsame name (``thumbnail``) for the templatetag module::\n\n    {% load sorl_thumbnail %}\n    {% thumbnail item.image \"100x100\" crop=\"center\" as im %}\n        \u003cimg src=\"{{ im.url }}\" width=\"{{ im.width }}\" height=\"{{ im.height }}\"\u003e\n    {% endthumbnail %}\n\nFrequently asked questions\n==========================\n\nIs so slow in Amazon S3!\n------------------------\n\nPossible related to the implementation of your Amazon S3 Backend, see the `issue #351`_\ndue the storage backend reviews if there is an existing thumbnail when tries to\ngenerate the thumbnail that makes an extensive use of the S3 API\n\nA fast workaround if you are not willing to tweak your storage backend is to set::\n\n   THUMBNAIL_FORCE_OVERWRITE = True\n\nSo it will avoid to overly query the S3 API.\n\n\n.. |gh-actions| image:: https://github.com/jazzband/sorl-thumbnail/workflows/Test/badge.svg\n    :target: https://github.com/jazzband/sorl-thumbnail/actions\n.. |docs| image:: https://readthedocs.org/projects/pip/badge/?version=latest\n    :alt: Documentation for latest version\n    :target: https://sorl-thumbnail.readthedocs.io/en/latest/\n.. |pypi| image:: https://img.shields.io/pypi/v/sorl-thumbnail.svg\n    :target: https://pypi.python.org/pypi/sorl-thumbnail\n    :alt: sorl-thumbnail on PyPI\n.. |python-badge| image:: https://img.shields.io/pypi/pyversions/sorl-thumbnail.svg\n    :target: https://pypi.python.org/pypi/sorl-thumbnail\n    :alt: Supported Python versions\n.. |django-badge| image:: https://img.shields.io/pypi/djversions/sorl-thumbnail.svg\n    :target: https://pypi.python.org/pypi/sorl-thumbnail\n    :alt: Supported Python versions\n.. |codecov| image:: https://codecov.io/gh/jazzband/sorl-thumbnail/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/jazzband/sorl-thumbnail\n   :alt: Coverage\n.. |jazzband-badge| image:: https://jazzband.co/static/img/badge.svg\n   :target: https://jazzband.co/\n   :alt: Jazzband\n.. |jazzband| image:: https://jazzband.co/static/img/jazzband.svg\n   :target: https://jazzband.co/\n   :alt: Jazzband\n\n.. _`Pillow`: https://pillow.readthedocs.io/\n.. _`ImageMagick`: https://imagemagick.org/\n.. _`PIL`: https://python-pillow.org/\n.. _`Wand`: https://docs.wand-py.org/\n.. _`pgmagick`: https://pgmagick.readthedocs.io/\n.. _`vipsthumbnail`: https://www.libvips.org/API/current/Using-vipsthumbnail.html\n\n.. _`Template examples`: https://sorl-thumbnail.readthedocs.io/en/latest/examples.html#template-examples\n.. _`Model examples`: https://sorl-thumbnail.readthedocs.io/en/latest/examples.html#model-examples\n.. _`Low level API examples`: https://sorl-thumbnail.readthedocs.io/en/latest/examples.html#low-level-api-examples\n.. _`issue #351`: https://github.com/jazzband/sorl-thumbnail/issues/351\n.. _`Django supported versions policy`: https://www.djangoproject.com/download/#supported-versions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazzband%2Fsorl-thumbnail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjazzband%2Fsorl-thumbnail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazzband%2Fsorl-thumbnail/lists"}