[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GMG-Devel] Thumbnail handling branch ready for pulling (issue 533)
From: |
Sebastian Spaeth |
Subject: |
[GMG-Devel] Thumbnail handling branch ready for pulling (issue 533) |
Date: |
Fri, 09 Nov 2012 10:31:59 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20120922 Icedove/10.0.7 |
I created http://issues.mediagoblin.org/ticket/533 to track this.
This is pre-work for the PDF media type handling which is supposed to
show default pdf fallback icons in the beginning. It works by adding a
MediaEntry.thumb_url property that template designers can use.
Rather than:
{{ request.app.public_store.file_url(media_entry.media_files['thumb']) }}
you can use:
{{ media_entry.thumb_url }}
This is automatically fall back to the static default icon as configured
in the media's MEDIA_MANAGER['default_thumb'].
It also adds a default "image" fallback icon (the configured URL did not
exist), based on the Public-Domain Tango icon. Our esteemed web designer
might want to replace it with a proper "broken image" icon?
Code is tested and works for me. I am bad at writing tests though, not
sure how I would write one for this.
Spaetz
The code is in branch get_thumb_url on
git://gitorious.org/~spaetz/mediagoblin/spaetz-mediagoblin.git
The patch in question is:
https://gitorious.org/~spaetz/mediagoblin/spaetz-mediagoblin/commit/2534712afaa7833f12f55dc6a611a686485064f2
- [GMG-Devel] Thumbnail handling branch ready for pulling (issue 533),
Sebastian Spaeth <=