Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_image and write_image now use LocalFileSystem as default #140

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions niceml/utilities/ioutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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()


Expand Down
Loading