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:
parent
f20e488518
commit
7952487c2a
|
@ -76,6 +76,8 @@ while indexnow < arraylength:
|
||||||
cleanname = namecleaner(newname)
|
cleanname = namecleaner(newname)
|
||||||
print("cleanname = "+cleanname)
|
print("cleanname = "+cleanname)
|
||||||
if cleanname != "":
|
if cleanname != "":
|
||||||
|
if len(cleanname) > 250:
|
||||||
|
cleanname = cleanname[0:250]
|
||||||
cleanname = cleanname + basename[len(basename)-4:len(basename)]
|
cleanname = cleanname + basename[len(basename)-4:len(basename)]
|
||||||
os.rename(absolutebasepathin+"\\"+basename, absolutebasepathout+"\\"+cleanname)
|
os.rename(absolutebasepathin+"\\"+basename, absolutebasepathout+"\\"+cleanname)
|
||||||
print(basename+" is now renamed as "+cleanname)
|
print(basename+" is now renamed as "+cleanname)
|
||||||
|
|
Loading…
Reference in New Issue