Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -147,13 +147,13 @@ if st.button("Generate HeatMap & DataFrame"):
|
|
147 |
for idx, image in enumerate(selected_images):
|
148 |
# Convert the image to a format that can be inserted into Excel
|
149 |
image_stream = io.BytesIO()
|
150 |
-
image.save(image_stream, format='
|
151 |
image_stream.seek(0)
|
152 |
# Calculate the scaling factor to fit the image inside the cell
|
153 |
cell_width = 64
|
154 |
scale_factor = cell_width / image.width
|
155 |
# Insert the image into the cell
|
156 |
-
worksheet.insert_image(f'J{idx + 2}', 'image.
|
157 |
'image_data': image_stream,
|
158 |
'x_scale': scale_factor,
|
159 |
'y_scale': scale_factor,
|
|
|
147 |
for idx, image in enumerate(selected_images):
|
148 |
# Convert the image to a format that can be inserted into Excel
|
149 |
image_stream = io.BytesIO()
|
150 |
+
image.save(image_stream, format='JPEG') # image.save(image_stream, format='JPEG') # Save the image as JPEG; or PNG
|
151 |
image_stream.seek(0)
|
152 |
# Calculate the scaling factor to fit the image inside the cell
|
153 |
cell_width = 64
|
154 |
scale_factor = cell_width / image.width
|
155 |
# Insert the image into the cell
|
156 |
+
worksheet.insert_image(f'J{idx + 2}', 'image.jpg', { #or image.png
|
157 |
'image_data': image_stream,
|
158 |
'x_scale': scale_factor,
|
159 |
'y_scale': scale_factor,
|