Comments (6)
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.
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.
We access those attributes simply as a way of determining whether value
is an image or not.
from django-form-utils.
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.
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.
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)
- form_util.forms.BetterModelForm and form_util.forms.BetterForm has a mixins HOT 1
- [Question] Adding fields dynamically to a fieldset HOT 1
- RemovedInDjango19Warning
- Are nested fieldsets supported? HOT 1
- RemovedInDjango110 warning: render() must be called with a dict, not a Context
- Proposal: migrate project to Jazzband HOT 1
- ImageWidget and Amazon S3 HOT 6
- Version 1.0 is not compatible with Django 1.4 HOT 3
- Errors under Django 1.7rc1 HOT 1
- form
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-form-utils.