Comments (3)
As far as I can see, this functionality can also be used for creating watermarks on the image. So, I'm quite interested too.
from easy-thumbnails.
This worked for me:
def make_square(image, size, **kwargs):
raise TypeError(type(image))
Then in settings.py, I have
THUMBNAIL_PROCESSORS = (
'myproject.processors.make_square',
)
One important thing to note: if you setup your processors like above, you won't get any of the default processors. You can snatch the default ones from defaults.py in the easy_thumbnails source and append yours to the bottom, if you need them.
from easy_thumbnails import defaults
THUMBNAIL_PROCESSORS = defaults.PROCESSORS + (
'myproject.processors.make_square',
)
from easy-thumbnails.
Firstly, THUMBNAIL_DEBUG = True
is used for debugging the thumbnail tag.
Your error will be due to leaving off the **kwargs
. I've added this to the docs (and stole rjregenold's suggestion of just importing defaults rather than hardcoding them because I do that myself already).
from easy-thumbnails.
Related Issues (20)
- Template fails to render due to ZeroDivisionError when input is corrupted
- ContentFile without a name breaks easy_thumbnails
- ANTIALIAS is deprecated and will be removed in Pillow 10
- svglib dependency is missing HOT 9
- Imoprt error
- Django 4.1 template tag 'thumbnail' conflict with sorl-thumbnails
- Saving TIFF image raises Value error HOT 2
- How to force a single field to convert the thumbails to JPG even if PNG with alpha was provided
- DeprecationWarning from get_storage_class HOT 1
- Lots of duplicated queries HOT 1
- Support for pillow >= 10.0.0.0 HOT 1
- SVG File.width - This backend doesn't support absolute paths. HOT 2
- ZeroDivisionError when thumbnail is passed a 0x0 SVG HOT 1
- Increase File name field length HOT 1
- Allow use of new Django4.2 STORAGE config
- animated gifs - preserve animation, as PIL/Pillow supports it HOT 3
- up to date docs?
- Data too long on serving thumbnails
- DeprecationWarning: 'imghdr' is deprecated and slated for removal in Python 3.13 HOT 1
- Django 4.2.14 (and 5.0.7) fixes of CVE-2024-39330 break thumbnail generation when optimisations is used HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easy-thumbnails.