Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

imagemodels.py line 194 opens a thumb/image file on every (non admin) rendering request #105

Closed
katzlbt opened this Issue Jan 17, 2014 · 0 comments

Comments

Projects
None yet
2 participants

katzlbt commented Jan 17, 2014

imagemodels.py line 194 (using the self.file.file property) makes easy_thumbnails open an image file on the disk that is never used. The file-open is executed every time a template is rendered, draining performance (especially on slow storages). See http://github.com/SmileyChris/easy-thumbnails/issues/293

"website/cmslibs/filer/models/imagemodels.py", line 194, in easy_thumbnails_thumbnailer
file=self.file.file, name=self.file.name,

Stacktrace:

"website/cmslibs/easy_thumbnails/templatetags/thumbnail.py", line 103, in render
thumbnail = get_thumbnailer(source).get_thumbnail(opts)
"website/cmslibs/easy_thumbnails/files.py", line 46, in get_thumbnailer
if hasattr(obj, 'easy_thumbnails_thumbnailer'):
"website/cmslibs/filer/models/imagemodels.py", line 194, in easy_thumbnails_thumbnailer
file=self.file.file, name=self.file.name,
"/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/db/models/fields/files.py", line 46, in getfile
self.file = self.storage.open(self.name, 'rb')
"/base/data/home/runtimes/python27/python27lib/versions/third_party/django-1.5/django/core/files/storage.py", line 36, in open
return self._open(name, mode)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment