memex-in commited on
Commit
0891f86
·
verified ·
1 Parent(s): 4c475a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -22,8 +22,9 @@ def capture_screenshot(url, output_path='screenshot.png'):
22
  # Function to convert an image to ASCII art
23
  def convert_to_ascii(image_path):
24
  try:
25
- output = ascii_magic.from_image_path(image_path, columns=100, mode=ascii_magic.Modes.ASCII)
26
- return str(output)
 
27
  except Exception as e:
28
  raise Exception(f"Failed to convert image to ASCII: {e}")
29
 
 
22
  # Function to convert an image to ASCII art
23
  def convert_to_ascii(image_path):
24
  try:
25
+ # Correct usage of ascii_magic to convert image to ASCII
26
+ ascii_art = ascii_magic.to_ascii_image(image_path, columns=100, mode='mono')
27
+ return ascii_art
28
  except Exception as e:
29
  raise Exception(f"Failed to convert image to ASCII: {e}")
30