From a5e8fdb875adce6697f46167ad8cb9677d8a2e29 Mon Sep 17 00:00:00 2001 From: Aleks-Daniel Jakimenko-Aleksejev Date: Sat, 14 Nov 2020 06:14:51 +0200 Subject: [PATCH] Fix mipmap generation for paths with dots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full paths can contain dots in parent directories (e.g. “/home/foo/.steam/”), so it is important to work with basenames only. --- genmipmaps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genmipmaps.py b/genmipmaps.py index 16e88db..f8ecd01 100644 --- a/genmipmaps.py +++ b/genmipmaps.py @@ -64,7 +64,7 @@ def loadSheets(sheetnames): sheets = {} for name in sheetnames: b = io.BytesIO(readFile(name)) - sheets[int(name.split('.')[1])] = Image.open(b) + sheets[int(os.path.basename(name).split('.')[1])] = Image.open(b) return sheets