Giter VIP home page Giter VIP logo

Comments (6)

carljm avatar carljm commented on June 9, 2024

Yes, this is not ideal. I'm not sure what would be a good way to reliably identify image values that wouldn't suffer from this problem; if you have a proposal (and better, a patch!) I'd welcome it.

from django-form-utils.

tsailiming avatar tsailiming commented on June 9, 2024

Hi,
Not quite sure I understand this. Why do we need to access the attribute when is not used?

if hasattr(value, 'width') and hasattr(value, 'height'):
    image_html = thumbnail(value.name, self.width, self.height)

from django-form-utils.

carljm avatar carljm commented on June 9, 2024

We access those attributes simply as a way of determining whether value is an image or not.

from django-form-utils.

tsailiming avatar tsailiming commented on June 9, 2024

I'm working with django-storages using S3. Apparently, the width/height will always be fetched and is described in this ticket: https://code.djangoproject.com/ticket/8307 . As a result, it has to read the file to get the up to date weight/height and will be slow for cloud based storages.

A similar issue on SO: http://stackoverflow.com/questions/5877497/storing-images-and-thumbnails-on-s3-in-django

Since I'm working on the ImageField, should I override this on my own widget to prevent the extra hit on S3?

from django-form-utils.

carljm avatar carljm commented on June 9, 2024

I don't know what you should do in that case, I haven't worked with ImageField and remote storages.

Regarding this specific bug, I'd welcome proposals of an alternative way to reliably tell whether value is an image that can be (potentially) thumbnailed.

from django-form-utils.

thekashifmalik avatar thekashifmalik commented on June 9, 2024

I can take a look next week, but if anyone else wants to take shot?

Sent from my iPhone 4S

On Apr 12, 2013, at 10:26 AM, Carl Meyer [email protected] wrote:

I don't know what you should do in that case, I haven't worked with
ImageField and remote storages.

Regarding this specific bug, I'd welcome proposals of an alternative way to
reliably tell whether value is an image that can be (potentially)
thumbnailed.


Reply to this email directly or view it on
GitHubhttps://github.com//issues/2#issuecomment-16299210
.

from django-form-utils.

Related Issues (11)

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.