Skip to content

Commit

Permalink
Debug commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bhvishal9 committed Aug 20, 2024
1 parent 0b2b95c commit 15bfcd1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vectorizing/util/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self):
def convert_RGB_A(img):
if img.mode == 'RGB' or img.mode == 'RGBA':
return img

map = {
'1': 'RGB',
'L': 'RGB',
Expand All @@ -33,8 +33,9 @@ def convert_RGB_A(img):

if not img.mode in map:
raise ImageFormatError()

return img.convert(map.get(img.mode))


def try_read_image_from_path(path):
try:
Expand All @@ -49,4 +50,4 @@ def try_read_image_from_url(url):
img = Image.open(BytesIO(resp.content))
except:
raise URLReadError()
return convert_RGB_A(img)
return convert_RGB_A(img)

0 comments on commit 15bfcd1

Please sign in to comment.