修复了文件名中的点号'.'对文件扩展的影响
parent
6e3b1d7ddc
commit
d1b679a1db
3
main.py
3
main.py
|
|
@ -36,7 +36,8 @@ def convert_img(path = os.path.abspath('.')):
|
||||||
return 1
|
return 1
|
||||||
elif file.endswith('.jpg') or file.endswith('.jpeg'):
|
elif file.endswith('.jpg') or file.endswith('.jpeg'):
|
||||||
img = Image.open(path + '\\' + file)
|
img = Image.open(path + '\\' + file)
|
||||||
img.save(path + '\\' + file.split('.')[0] + ".png", "PNG")
|
dot_index = file.rfind('.')
|
||||||
|
img.save(path + '\\' + file[dot_index:] + ".png", "PNG")
|
||||||
|
|
||||||
|
|
||||||
def gen_filelist(path = os.path.abspath('.')):
|
def gen_filelist(path = os.path.abspath('.')):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue