Skip to content

Commit

Permalink
iiif: resolve relative tiles storage against instance path
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed May 8, 2024
1 parent b3e38f4 commit e07086a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion invenio_rdm_records/services/iiif/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ def __init__(self, *, base_path: Union[str, None] = None, **kwargs):
@property
def base_path(self):
"""Return base path from object/config."""
return Path(
path = Path(
self._base_path or current_app.config.get("IIIF_TILES_STORAGE_BASE_PATH")
)
if path.is_absolute():
return path
# If relative path, resolve against instance path
return Path(current_app.instance_path) / path

def _get_dir(self, record: RDMRecord) -> Path:
"""Get directory."""
Expand Down

0 comments on commit e07086a

Please sign in to comment.