From: Mikko Rasa Date: Wed, 20 Jun 2018 10:36:44 +0000 (+0300) Subject: Correctly handle luminance-only formats in maketex.py X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7de9a53a36fd4cc2bb08739b25695d3054f0d22a;p=libs%2Fgl.git Correctly handle luminance-only formats in maketex.py --- 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