Update utility.py
Added other image formats that are already verified by imghdr. Not sure about "pgm" format?pull/4424/head
parent
5651740b46
commit
d5caa11374
|
@ -51,7 +51,7 @@ def get_image_file_list(img_file):
|
||||||
if img_file is None or not os.path.exists(img_file):
|
if img_file is None or not os.path.exists(img_file):
|
||||||
raise Exception("not found any img file in {}".format(img_file))
|
raise Exception("not found any img file in {}".format(img_file))
|
||||||
|
|
||||||
img_end = {'jpg', 'bmp', 'png', 'jpeg', 'rgb', 'tif', 'tiff', 'gif', 'GIF'}
|
img_end = {'jpg', 'bmp', 'png', 'jpeg', 'rgb', 'tif', 'tiff', 'gif', 'GIF','webp','ppm'}
|
||||||
if os.path.isfile(img_file) and imghdr.what(img_file) in img_end:
|
if os.path.isfile(img_file) and imghdr.what(img_file) in img_end:
|
||||||
imgs_lists.append(img_file)
|
imgs_lists.append(img_file)
|
||||||
elif os.path.isdir(img_file):
|
elif os.path.isdir(img_file):
|
||||||
|
|
Loading…
Reference in New Issue