From 5f7deed5ca9587eaa780f8396771ff0b6ad36a4a Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 18 Dec 2014 12:59:04 +0100 Subject: [PATCH] fix default grapher sizes --- example/sandbox/settings.py | 3 ++- telemeta/views/item.py | 10 +++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/example/sandbox/settings.py b/example/sandbox/settings.py index d078bb51..a94da9f2 100644 --- a/example/sandbox/settings.py +++ b/example/sandbox/settings.py @@ -141,6 +141,7 @@ INSTALLED_APPS = ( 'sorl.thumbnail', 'timezones', 'jqchat', + 'ipauth', 'extra_views', 'debug_toolbar', 'bootstrap3', @@ -179,7 +180,6 @@ TELEMETA_DOWNLOAD_ENABLED = True TELEMETA_STREAMING_FORMATS = ('mp3', 'ogg') TELEMETA_DOWNLOAD_FORMATS = ('wav', 'mp3', 'ogg', 'flac') TELEMETA_PUBLIC_ACCESS_PERIOD = 51 -TELEMETA_DEFAULT_WAVEFORM_SIZES = ['360x130', '640x130'] AUTH_PROFILE_MODULE = 'telemeta.userprofile' SESSION_EXPIRE_AT_BROWSER_CLOSE = False @@ -191,6 +191,7 @@ EMAIL_HOST = 'localhost' DEFAULT_FROM_EMAIL = 'webmaster@parisson.com' TIMESIDE_DEFAULT_GRAPHER_ID = 'waveform_centroid' +TIMESIDE_DEFAULT_WAVEFORM_SIZES = ['360x130', '640x130'] TIMESIDE_AUTO_ZOOM = False # Settings for django-bootstrap3 diff --git a/telemeta/views/item.py b/telemeta/views/item.py index 1402abd5..cecadfcb 100644 --- a/telemeta/views/item.py +++ b/telemeta/views/item.py @@ -462,13 +462,9 @@ class ItemView(ItemBaseMixin): def item_visualize(self, request, public_id, grapher_id, width, height): if not isinstance(width, int) or not isinstance(height, int): - if settings.TELEMETA_DEFAULT_WAVEFORM_SIZES: - default_size = settings.TELEMETA_DEFAULT_WAVEFORM_SIZES[0].split('x') - width = default_size[0] - height = default_size[1] - else: - width = 360 - height = 130 + size = self.default_grapher_sizes + width = size.split('x')[0] + height = size.split('x')[1] item = MediaItem.objects.get(public_id=public_id) mime_type = 'image/png' -- 2.39.5