From a9078126ed61cf08859dd67226c39666456227ca Mon Sep 17 00:00:00 2001 From: BernhardKoschicek Date: Fri, 22 Sep 2023 16:40:58 +0200 Subject: [PATCH] made vips for both os --- openatlas/views/file.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openatlas/views/file.py b/openatlas/views/file.py index e64a2d192..d46f04556 100644 --- a/openatlas/views/file.py +++ b/openatlas/views/file.py @@ -1,3 +1,4 @@ +import os import subprocess from pathlib import Path from typing import Any, Union, Optional @@ -81,8 +82,9 @@ def make_iiif_available(id_: int): def convert_image_to_iiif(id_): path = Path(app.config['IIIF_DIR']) / app.config['IIIF_PREFIX'] / str(id_) + vips = "vips" if os.name == 'posix' else "vips.exe" command = \ - (f"vips.exe tiffsave {get_file_path(id_)} {path} " + (f"{vips} tiffsave {get_file_path(id_)} {path} " f"--tile --pyramid --compression deflate " f"--tile-width 256 --tile-height 256") subprocess.Popen(command, shell=True)