Comments (3)
FYI: this pluggable app really is just a bit too awesome. You need to dull it down a bit or start selling it so we can resent you for it. Sooo easy and sooo great.
from django-versatileimagefield.
Hey @robmoggach !
First off: thanks for the kind words about this project, I really appreciate it! Returning cropped image width and height is definitely possible but would introduce a non-insignificant performance hit to your application since getting those values would necessitate either...:
- ...a calculation anytime a cropped rendition is requested (based on the 'master' image width height) or...
- ...opening the cropped rendition image file from storage to determine its size.
SIDE NOTE: Getting the width/height of a master/original image doesn't incur this same performance hit since those values are only calculated once (when a new image is associated with a field) and then stored in the database (if you define a width_field & height field (relevant docs here)).
If you have a low traffic application with only a few images on a page it wouldn't be that big of a deal but a grid of 20+ thumbnails would start to significantly impact page load.
Whenever a new feature is requested on this application – and I'm weighing whether-or-not I should implement it – I first ask myself if adding it will makes developers lives easier. In this case that's definitely true. However, right afterwards I ask if said feature would incur a significant performance hit. In this case – unfortunately – it does so, for the moment at least, I wouldn't consider adding it to the project.
All that said, if you can figure out a way to get these values with a minimum amount of overhead and want to open a PR, I'd definitely seriously considering merging it into this project!
Also, could you elaborate a bit more about what sort of information your after in regards to this:
Documentation on built-in sizers and filters could be expanded on a bit too... please!
from django-versatileimagefield.
Sounds good. Makes sense.
I think I was referring to examples in templates and how to chain sizers and filters. I found the documentation eventfully but maybe the quick start section could use another example snippet.
On Jul 31, 2016, at 9:11 AM, Jonathan Ellenberger [email protected] wrote:
Hey @robmoggach !
First off: thanks for the kind words about this project, I really appreciate it! Returning cropped image width and height is definitely possible but would introduce a non-insignificant performance hit to your application since getting those values would necessitate either...:
...a calculation anytime a cropped rendition is requested (based on the 'master' image width height) or...
...opening the cropped rendition image file from storage to determine its size.
SIDE NOTE: Getting the width/height of a master/original image doesn't incur this same performance hit since those values are only calculated once (when a new image is associated with a field) and then stored in the database (if you define a width_field & height field (relevant docs here)).If you have a low traffic application with only a few images on a page it wouldn't be that big of a deal but a grid of 20+ thumbnails would start to significantly impact page load.
Whenever a new feature is requested on this application – and I'm weighing whether-or-not I should implement it – I first ask myself if adding it will makes developers lives easier. In this case that's definitely true. However, right afterwards I ask if said feature would incur a significant performance hit. In this case – unfortunately – it does so, for the moment at least, I wouldn't consider adding it to the project.
All that said, if you can figure out a way to get these values with a minimum amount of overhead and want to open a PR, I'd definitely seriously considering merging it into this project!
Also, could you elaborate a bit more about what sort of information your after in regards to this:
Documentation on built-in sizers and filters could be expanded on a bit too... please!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
from django-versatileimagefield.
Related Issues (20)
- Unclear docs on using VersatileImageFieldWarmer with rendition sets HOT 1
- python-magic 0.4.20 incompatible
- Fails to work with django-cacheops HOT 2
- How to store filename returned by storage for sized images? HOT 1
- Test with Python3.9
- Test with Django 3.1 and 3.2
- Add Django 3.2 Compatibility HOT 1
- Test with djangorestframework 3.11 and 3.12
- error to upload images using django-rest and angular HOT 1
- versatileimagefield How to use Django Graphql
- Deleting all created images for the image without extension fails
- VersatileImageFieldWarmer regenerate images for delete rendition key set
- Question: is it possible to use this app with static files?
- AttributeError: module 'magic' has no attribute 'from_buffer' HOT 1
- Django 4 HOT 3
- Question: Crop as circle
- Extra queries when warming with VersatileImageFieldWarmer
- django-versatileimagefield doesn't work on Pillow >= 10.0.0 released 1 July HOT 5
- Created images not deleted when using image_key_post_processor
- Configurable exception handling
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 django-versatileimagefield.