Adityadn commited on
Commit
d0e5ac1
·
verified ·
1 Parent(s): e1a05e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
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
- ffmpeg
25
- .input(image)
26
- .output(output_file, format=target_format)
27
- .overwrite_output() # Overwrite jika file sudah ada
28
- .run(quiet=True) # Supaya tidak menampilkan output FFmpeg di konsol
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}"