From 2e4ad359623916f5ca9f6ec11f5353a1a85a77d2 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Fri, 9 Nov 2012 10:13:04 +0100 Subject: Simplify/Robustify the thumbnail URL usage in templates So far templates required a very complex blurb to simply insert a thumbnail URL, exposing much of the internal logic to the template designer. In addition, we would fail with an error if for some reason the media_files['thumb'] entry was never populated. This adds the MediaEntry.thumb_url property that template designers can simply use. It will do the right thing, either fetching the proper thumbnail or hand back a generic icon specified in a media's MEDIA_MANAGER as "default_thumb". Add an image default fallback icon (stolen from Tangos, which are Public Domain since version 0.8.90 as I understand) since the one we referred to was not existing. Perhaps, a "broken image" icon would be better, but I'll leave that to our capable designers. All templates have been modified to make use of the new thumb_url function. Signed-off-by: Sebastian Spaeth --- mediagoblin/media_types/image/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/media_types') diff --git a/mediagoblin/media_types/image/__init__.py b/mediagoblin/media_types/image/__init__.py index d4720fab..36d7c201 100644 --- a/mediagoblin/media_types/image/__init__.py +++ b/mediagoblin/media_types/image/__init__.py @@ -24,5 +24,5 @@ MEDIA_MANAGER = { # 'mediagoblin.media_types.image.processing'? "sniff_handler": sniff_handler, "display_template": "mediagoblin/media_displays/image.html", - "default_thumb": "images/media_thumbs/image.jpg", + "default_thumb": "images/media_thumbs/image.png", "accepted_extensions": ["jpg", "jpeg", "png", "gif", "tiff"]} -- cgit v1.2.3