From 7de9a53a36fd4cc2bb08739b25695d3054f0d22a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 20 Jun 2018 13:36:44 +0300 Subject: [PATCH] Correctly handle luminance-only formats in maketex.py --- scripts/maketex.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/maketex.py b/scripts/maketex.py index 82a331a9..2e106948 100755 --- a/scripts/maketex.py +++ b/scripts/maketex.py @@ -39,7 +39,10 @@ def make_tex(fn, filter="LINEAR", anisotropy=0, wrap=None, srgb=False): data = list(img.getdata()) for y in range(img.size[1]): i = (img.size[1]-1-y)*img.size[0] - result += escape("".join(["".join([chr(v) for v in p]) for p in data[i:i+img.size[0]]])) + if fmt=="LUMINANCE" or fmt=="SLUMINANCE": + result += escape("".join([chr(v) for v in data[i:i+img.size[0]]])) + else: + result += escape("".join(["".join([chr(v) for v in p]) for p in data[i:i+img.size[0]]])) result += "\";\n" return result -- 2.45.2