Comments (4)
I guess that'd be ok... or alternatively, perhaps the ThumbnailFile should be built with knowledge of the options it was generated with, allowing for a filter with no required options.
from easy-thumbnails.
I just want to comment on my design decision to make it a filter. First of all I think im.margin is ugly, is that really an explicit attribute for an image abstraction? Having the image abstraction to know of its requested size as well as the actual size also leads to some ugly coupling. As a filter you get one downside if you must and that is to have to set the size for the bounding box. The pros are:
- Its doesn't clutter the image abstraction.
- The filter is not tied to a thumbnail, it could be any image.
- You can have more margin than just the minumum.
from easy-thumbnails.
Yep, i'm not sold on im.margin, but I think giving the ThumbnailFile information so that you could optionally use the filter without an argument would be a fair enough use-case.
Thanks for your comments, sorl.
from easy-thumbnails.
I can certainly live with that solution. Less duplication = more power to us
from easy-thumbnails.
Related Issues (20)
- Reportlab dependency causes security warning HOT 9
- Cant install easy-thumbnails with Poetry and Django 4 HOT 4
- 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
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.