sorl-thumbnail: thumbnails for Django¶
You write the size in the template, or ask for it in Python, and sorl-thumbnail makes the thumbnail on first use, saves it on your media storage and remembers it in a key-value store, so later renders cost no image work and no storage request. It resizes with Pillow by default, or with libvips, ImageMagick, GraphicsMagick, Wand or pgmagick, and writes to any Django storage, Amazon S3 included.
New here? Start with How do I make thumbnails in Django?.
- How do I make thumbnails in Django?
- Installation & Setup
- Requirements
- Template tags and filters
- Examples
- Management commands
- Errors & Logging
- How sorl-thumbnail operates
- Thumbnails on Amazon S3
- Troubleshooting
- The tag renders nothing
- Invalid block tag ‘endthumbnail’
- I replaced the image and the thumbnail did not change
- A transparent image has a black background
- I changed a setting and the old thumbnails look the same
- NotImplementedError, or “crop=’smart’ is only supported by the PIL and vips engines”
- EngineError: convert is not installed or not on PATH
- Captured stderr: WARNING: The convert command is deprecated in IMv7
- EngineError: convert did not finish in 60 seconds
- The convert command wrote JPEG instead of AVIF
- “Upload a valid image” for a file that opens elsewhere
- A portrait photo comes out squashed or rotated
- Pages are slow on Amazon S3
- A remote image source hangs the page
- Animated GIF thumbnails are slow
- Reference
- Choosing a thumbnail library
- Contributing