Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -22,10 +22,6 @@ def convert_image_ffmpeg(image, target_format):
|
|
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}"
|
@@ -38,7 +34,7 @@ interface = gr.Interface(
|
|
38 |
gr.Dropdown(label="Select Target Format", choices=supported_formats)
|
39 |
],
|
40 |
outputs=gr.File(label="Converted Image"),
|
41 |
-
title="Image Format Converter
|
42 |
description="Upload an image and select any target format for conversion using FFmpeg. Supports popular image formats.",
|
43 |
css="footer {visibility: hidden}"
|
44 |
)
|
|
|
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 |
return output_file
|
26 |
except Exception as e:
|
27 |
return f"Error: {e}"
|
|
|
34 |
gr.Dropdown(label="Select Target Format", choices=supported_formats)
|
35 |
],
|
36 |
outputs=gr.File(label="Converted Image"),
|
37 |
+
title="Image Format Converter",
|
38 |
description="Upload an image and select any target format for conversion using FFmpeg. Supports popular image formats.",
|
39 |
css="footer {visibility: hidden}"
|
40 |
)
|