mirror of https://github.com/django/django.git
Fixed #1964 -- Fixed bug in fetching the dimensions of an ImageField. Thanks, Armin Ronacher
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3168 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b2e5c4ef02
commit
f2aab5b913
|
@ -363,7 +363,7 @@ class Model(object):
|
||||||
cachename = "__%s_dimensions_cache" % field.name
|
cachename = "__%s_dimensions_cache" % field.name
|
||||||
if not hasattr(self, cachename):
|
if not hasattr(self, cachename):
|
||||||
from django.utils.images import get_image_dimensions
|
from django.utils.images import get_image_dimensions
|
||||||
filename = self._get_FIELD_filename(field)()
|
filename = self._get_FIELD_filename(field)
|
||||||
setattr(self, cachename, get_image_dimensions(filename))
|
setattr(self, cachename, get_image_dimensions(filename))
|
||||||
return getattr(self, cachename)
|
return getattr(self, cachename)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue