forked from Dawn_Ocean/ZJUEVA-Reimburse
修复了文件名中的点号'.'对文件扩展的影响
This commit is contained in:
@@ -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('.')):
|
||||||
|
|||||||
Reference in New Issue
Block a user