Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -20,14 +20,12 @@ def convert_image_ffmpeg(image, target_format):
|
|
20 |
output_file = f"flowly_ai_image_converter_{base_name}.{target_format.lower()}"
|
21 |
|
22 |
# Perintah FFmpeg untuk mengonversi gambar
|
23 |
-
(
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
)
|
30 |
-
|
31 |
return output_file
|
32 |
except Exception as e:
|
33 |
return f"Error: {e}"
|
|
|
20 |
output_file = f"flowly_ai_image_converter_{base_name}.{target_format.lower()}"
|
21 |
|
22 |
# Perintah FFmpeg untuk mengonversi gambar
|
23 |
+
ffmpeg.input(image).output(output_file, format=target_format).overwrite_output().run() # Supaya tidak menampilkan output FFmpeg di konsol
|
24 |
+
|
25 |
+
# Convert the image to the desired format using Pillow
|
26 |
+
img = Image.open(output_file)
|
27 |
+
img.save(output_file, target_format.upper()) # Save with the desired format
|
28 |
+
|
|
|
|
|
29 |
return output_file
|
30 |
except Exception as e:
|
31 |
return f"Error: {e}"
|