Spaces:
Sleeping
Sleeping
Update pages/lastimev4.py
Browse files- pages/lastimev4.py +3 -1
pages/lastimev4.py
CHANGED
|
@@ -142,9 +142,11 @@ def process_images_stream(images, format_option, speed, temp_dir, available_year
|
|
| 142 |
info_file_content = []
|
| 143 |
for i, (img, year) in enumerate(zip(images, available_years)):
|
| 144 |
if img is not None:
|
|
|
|
|
|
|
| 145 |
# Sauvegarde de l'image en JPEG
|
| 146 |
img_path = os.path.join(temp_dir, f"image_{year}.jpg")
|
| 147 |
-
|
| 148 |
zipf.write(img_path, os.path.basename(img_path))
|
| 149 |
os.remove(img_path)
|
| 150 |
|
|
|
|
| 142 |
info_file_content = []
|
| 143 |
for i, (img, year) in enumerate(zip(images, available_years)):
|
| 144 |
if img is not None:
|
| 145 |
+
# Conversion de l'image en mode RGB
|
| 146 |
+
rgb_img = img.convert('RGB')
|
| 147 |
# Sauvegarde de l'image en JPEG
|
| 148 |
img_path = os.path.join(temp_dir, f"image_{year}.jpg")
|
| 149 |
+
rgb_img.save(img_path, format="JPEG", quality=85) # Ajustez la qualité selon vos besoins
|
| 150 |
zipf.write(img_path, os.path.basename(img_path))
|
| 151 |
os.remove(img_path)
|
| 152 |
|