Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image/render.html doesn't work with THUMBNAIL_PRESERVE_FORMAT=True #243

Open
gavinwahl opened this issue Aug 21, 2014 · 0 comments
Open

Comments

@gavinwahl
Copy link
Member

Template error:
In template widgy/contrib/page_builder/templates/widgy/page_builder/image/render.html, error at line 3
   'unicode' object has no attribute 'name'
   1 : {% load thumbnail_libs %}
   2 : 
   3 :  {% sorl_thumbnail self.image.file.name "500x500" upscale=False as im %} 
   4 :   <img src="{{ im.url }}" alt="{{ self.image.label }}">
   5 : {% endthumbnail %}

...

File "sorl/thumbnail/templatetags/thumbnail.py" in render
  58.             return self._render(context)
File "sorl/thumbnail/templatetags/thumbnail.py" in _render
  136.         thumbnail = get_thumbnail(file_, geometry, **options)
File "sorl/thumbnail/shortcuts.py" in get_thumbnail
  8.     return default.backend.get_thumbnail(file_, geometry_string, **options)
File "sorl/thumbnail/base.py" in get_thumbnail
  77.             options.setdefault('format', self._get_format(file_))
File "sorl/thumbnail/base.py" in _get_format
  49.         file_extension = self.file_extension(file_)
File "sorl/thumbnail/base.py" in file_extension
  46.         return os.path.splitext(file_.name)[1].lower()

Exception Type: AttributeError at /widgets/
Exception Value: 'unicode' object has no attribute 'name'

I think this was broken by jazzband/sorl-thumbnail@f4cc08f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant