From 7df1cd77276fe4e305d7096bcdaf0bba2e753fc1 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Sat, 2 Nov 2019 18:09:21 +0100 Subject: [PATCH] Images to scanimation folder --- sorteerhoed/HITStore.py | 9 ++++++--- sorteerhoed/webserver.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sorteerhoed/HITStore.py b/sorteerhoed/HITStore.py index caba7c1..7f470c1 100644 --- a/sorteerhoed/HITStore.py +++ b/sorteerhoed/HITStore.py @@ -59,10 +59,13 @@ class HIT(Base): def getImagePath(self): - return os.path.join('www', self.getImageUrl()) + return os.path.join('../scanimation/interfaces/frames', f"{self.id}.jpg") - def getImageUrl(self): - return f"scans/{self.id}.jpg" +# def getImageUrl(self): +# return f"{self.id}.jpg" + + def getSvgImageUrl(self): + return f"scans/{self.id}.svg" def getStatus(self): if self.scanned_at: diff --git a/sorteerhoed/webserver.py b/sorteerhoed/webserver.py index 1731131..214113a 100644 --- a/sorteerhoed/webserver.py +++ b/sorteerhoed/webserver.py @@ -268,7 +268,7 @@ class DrawPageHandler(tornado.web.RequestHandler): logger.warning("No previous HIT, start from basic svg") image = "/basic.svg" else: - image = previous_hit.getImageUrl() + image = previous_hit.getSvgImageUrl() logger.info(f"Image url: {image}") self.set_header("Access-Control-Allow-Origin", "*")