Update Imagenamer.py

Solved a problem with images with too much text (NTFS only acepts max filename length of 255)
This commit is contained in:
StarShine 2020-11-01 14:04:12 +01:00
parent f20e488518
commit 7952487c2a
1 changed files with 2 additions and 0 deletions

View File

@ -76,6 +76,8 @@ while indexnow < arraylength:
cleanname = namecleaner(newname)
print("cleanname = "+cleanname)
if cleanname != "":
if len(cleanname) > 250:
cleanname = cleanname[0:250]
cleanname = cleanname + basename[len(basename)-4:len(basename)]
os.rename(absolutebasepathin+"\\"+basename, absolutebasepathout+"\\"+cleanname)
print(basename+" is now renamed as "+cleanname)