Skip to content

Commit 58b7f9e

Browse files
committed
🐛 open images on remote filesystems
1 parent 4eed7be commit 58b7f9e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

browsr/code_browser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ def render_document(
158158
return self.df_to_table(pandas_dataframe=df, table=self.table_view)
159159
elif document.suffix.lower() in [".png", ".jpg", ".jpeg"]:
160160
screen_width = self.app.size.width / 4
161-
with Image.open(document) as image:
161+
with document.open("rb") as buf:
162+
image = Image.open(buf)
162163
image_width = image.width
163164
image_height = image.height
164165
size_ratio = image_width / screen_width

0 commit comments

Comments
 (0)