Skip to content

Commit

Permalink
made vips for both os
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardKoschicek committed Sep 22, 2023
1 parent 491494b commit a907812
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openatlas/views/file.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import subprocess
from pathlib import Path
from typing import Any, Union, Optional
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a907812

Please sign in to comment.