Git Product home page Git Product logo

Comments (3)

rjmoggach avatar rjmoggach commented on August 16, 2024

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.

respondcreate avatar respondcreate commented on August 16, 2024

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...:

  1. ...a calculation anytime a cropped rendition is requested (based on the 'master' image width height) or...
  2. ...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.

rjmoggach avatar rjmoggach commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.