pypi sorl-thumbnail 13.5.0

13 minutes ago

sorl-thumbnail 13.5.0 lets your code catch a source image that can't be read, fixes thumbnail cleanup for storages that no longer exist, and needs Python 3.11 or later. Each change is explained in full in the changelog.

Highlights

  • Catch a source that can't be read. get_thumbnail(..., raise_errors=True) raises the error from the storage or the engine, usually an OSError, so you can show your own fallback. In the thumbnail tag, raise_errors=True renders the {% empty %} block, or raises with THUMBNAIL_DEBUG on. Before, a missing file was only logged and you got back a thumbnail that was never written. All engines. #644
  • Python 3.11 or later. Python 3.10 reached its end of life in October 2026, and Pillow 13.0.0, which fixes 43 security advisories, needs Python 3.11. On Python 3.10, pip keeps installing 13.4.0.

Fixes

  • manage.py thumbnail cleanup no longer stops when a storage was removed or renamed, with ImproperlyConfigured: Error importing module or ValueError: not enough values to unpack. Records whose storage no longer exists are removed, since their files can't be reached. #423
  • The convert engine, with ImageMagick or GraphicsMagick, no longer leaves an empty file in the temp directory each time a source can't be read.

Before you upgrade

  1. On Python 3.10: nothing breaks, pip stays on 13.4.0. Upgrade to Python 3.11 or later to get new releases and the patched Pillow.
  2. If thumbnail cleanup stopped with one of the errors above: run python manage.py thumbnail cleanup again.

Coming in 14.0

  • get_thumbnail will raise by default when the source can't be read, and the thumbnail tag will render {% empty %}. Until then you get a FutureWarning when it happens. Pass raise_errors=True to switch now, or raise_errors=False to keep today's behaviour without the warning. Docs

Links

Full Changelog: 13.4.0...13.5.0

Don't miss a new sorl-thumbnail release

NewReleases is sending notifications on new releases.