]> git.parisson.com Git - telemeta.git/commitdiff
fix wrong literal sizes for graphers
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 18 Dec 2014 11:47:30 +0000 (12:47 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 18 Dec 2014 11:47:30 +0000 (12:47 +0100)
telemeta/views/item.py

index 2adebde992f44c4f79de3ee66b2e336675fdab99..1402abd519e02d9bdc5398bb4e0afb17ed10cea6 100644 (file)
@@ -461,6 +461,15 @@ class ItemView(ItemBaseMixin):
         return response
 
     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
+
         item = MediaItem.objects.get(public_id=public_id)
         mime_type = 'image/png'
         grapher = self.get_grapher(grapher_id)