Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -276,7 +276,7 @@ def pdf_to_image(pdf_bytes):
|
|
| 276 |
doc = fitz.open(stream=pdf_bytes, filetype="pdf")
|
| 277 |
images = []
|
| 278 |
for page in doc:
|
| 279 |
-
pix = page.
|
| 280 |
img = Image.frombytes("RGB", [pix.width, pix.height], pix.samples)
|
| 281 |
images.append(img)
|
| 282 |
doc.close()
|
|
@@ -493,7 +493,7 @@ with tab1:
|
|
| 493 |
st.markdown("---")
|
| 494 |
st.subheader("๐ผ Image Gallery")
|
| 495 |
image_files = glob.glob("*.png") + glob.glob("*.jpg") + glob.glob("*.jpeg")
|
| 496 |
-
image_cols = st.slider("Gallery Columns ๐ผ", min_value=1, max_value=15, value=
|
| 497 |
if image_files:
|
| 498 |
cols = st.columns(image_cols)
|
| 499 |
for idx, image_file in enumerate(image_files):
|
|
@@ -509,7 +509,7 @@ with tab1:
|
|
| 509 |
st.markdown("---")
|
| 510 |
st.subheader("๐ฅ Video Gallery")
|
| 511 |
video_files = glob.glob("*.mp4")
|
| 512 |
-
video_cols = st.slider("Gallery Columns ๐ฌ", min_value=1, max_value=5, value=
|
| 513 |
if video_files:
|
| 514 |
cols = st.columns(video_cols)
|
| 515 |
for idx, video_file in enumerate(video_files):
|
|
|
|
| 276 |
doc = fitz.open(stream=pdf_bytes, filetype="pdf")
|
| 277 |
images = []
|
| 278 |
for page in doc:
|
| 279 |
+
pix = page.get_pixmap(matrix=fitz.Matrix(2.0, 2.0))
|
| 280 |
img = Image.frombytes("RGB", [pix.width, pix.height], pix.samples)
|
| 281 |
images.append(img)
|
| 282 |
doc.close()
|
|
|
|
| 493 |
st.markdown("---")
|
| 494 |
st.subheader("๐ผ Image Gallery")
|
| 495 |
image_files = glob.glob("*.png") + glob.glob("*.jpg") + glob.glob("*.jpeg")
|
| 496 |
+
image_cols = st.slider("Gallery Columns ๐ผ", min_value=1, max_value=15, value=5, key="image_cols")
|
| 497 |
if image_files:
|
| 498 |
cols = st.columns(image_cols)
|
| 499 |
for idx, image_file in enumerate(image_files):
|
|
|
|
| 509 |
st.markdown("---")
|
| 510 |
st.subheader("๐ฅ Video Gallery")
|
| 511 |
video_files = glob.glob("*.mp4")
|
| 512 |
+
video_cols = st.slider("Gallery Columns ๐ฌ", min_value=1, max_value=5, value=3, key="video_cols")
|
| 513 |
if video_files:
|
| 514 |
cols = st.columns(video_cols)
|
| 515 |
for idx, video_file in enumerate(video_files):
|