From 3d8bdb4557a58bc7dc2dfcbb7f826eabec1ddcc9 Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Fri, 14 Apr 2017 13:56:41 +0200 Subject: [PATCH] Serve images through Nginx --- telemeta/views/item.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telemeta/views/item.py b/telemeta/views/item.py index 2f6c73c7..ed0c6e41 100644 --- a/telemeta/views/item.py +++ b/telemeta/views/item.py @@ -259,10 +259,10 @@ class ItemView(ItemBaseMixin): if 'waveform_centroid' in grapher_id and self.cache_data.exists(old_image_file): image_file = old_image_file + path = self.cache_data.dir + os.sep + image_file if not self.cache_data.exists(image_file): source, _ = item.get_source() if source: - path = self.cache_data.dir + os.sep + image_file decoder = timeside.core.get_processor('file_decoder')(source) graph = grapher(width=width, height=height) (decoder | graph).run() @@ -272,7 +272,7 @@ class ItemView(ItemBaseMixin): #f.close() self.cache_data.add_file(image_file) - response = StreamingHttpResponse(self.cache_data.read_stream_bin(image_file), content_type=mime_type) + response = serve_media(path, content_type=mime_type) return response def list_export_extensions(self): -- 2.39.5