@danhachuel/thunderbolt 0.5.11 → 0.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +8 -2
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -4775,10 +4775,16 @@ def render_thumbnails():
|
|
|
4775
4775
|
with image_col:
|
|
4776
4776
|
image_path = record.get("image_path")
|
|
4777
4777
|
if image_path and image_path.is_file():
|
|
4778
|
-
|
|
4778
|
+
# Pass bytes to Streamlit and avoid the deprecated
|
|
4779
|
+
# ``use_container_width`` argument. On Windows the
|
|
4780
|
+
# deprecation warning can be emitted after the bootstrap
|
|
4781
|
+
# stream has been closed, which masks the real page with
|
|
4782
|
+
# ``ValueError: I/O operation on closed file``.
|
|
4783
|
+
image_bytes = image_path.read_bytes()
|
|
4784
|
+
st.image(image_bytes)
|
|
4779
4785
|
st.download_button(
|
|
4780
4786
|
"Descarregar thumbnail",
|
|
4781
|
-
data=
|
|
4787
|
+
data=image_bytes,
|
|
4782
4788
|
file_name=image_path.name,
|
|
4783
4789
|
mime="image/jpeg" if image_path.suffix.lower() in {".jpg", ".jpeg"} else "image/png",
|
|
4784
4790
|
key=f"thumbnail_download_{task_id}_{record['variant_index']}",
|
package/package.json
CHANGED