From 30ed1ec18783c3dab24bf07f439903699ff9221b Mon Sep 17 00:00:00 2001 From: Nils Uhrberg Date: Tue, 3 Dec 2024 11:57:58 +0100 Subject: [PATCH] fix: Read and write image ioutil now uses LocalFileSystem by default --- niceml/utilities/ioutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/niceml/utilities/ioutils.py b/niceml/utilities/ioutils.py index 32a7c23..d9c09ba 100644 --- a/niceml/utilities/ioutils.py +++ b/niceml/utilities/ioutils.py @@ -289,7 +289,7 @@ def write_image( dirname(filepath), exist_ok=True, ) - with file_system.open(filepath, "wb") as file: + with cur_fs.open(filepath, "wb") as file: file_format = filepath.rsplit(".")[-1] image.save(file, format=file_format, **kwargs) @@ -311,7 +311,7 @@ def read_image( cur_fs: AbstractFileSystem = file_system or LocalFileSystem() if not cur_fs.exists(filepath): raise FileNotFoundError(f"ImageFile not found: {filepath}") - with file_system.open(filepath, "rb") as file: + with cur_fs.open(filepath, "rb") as file: return Image.open(file, **kwargs).copy()