From 7952487c2aae6f9ae0837cc39ac35f82f6494666 Mon Sep 17 00:00:00 2001 From: StarShine Date: Sun, 1 Nov 2020 14:04:12 +0100 Subject: [PATCH] Update Imagenamer.py Solved a problem with images with too much text (NTFS only acepts max filename length of 255) --- Imagenamer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Imagenamer.py b/Imagenamer.py index 9a67a73..8945aac 100644 --- a/Imagenamer.py +++ b/Imagenamer.py @@ -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)