From 6e3e92605c374571f814a5352afbf57296182f76 Mon Sep 17 00:00:00 2001 From: pbsds Date: Mon, 3 Feb 2014 22:05:48 +0100 Subject: [PATCH] Made NTFT packing handle padding properly --- NTFT.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NTFT.py b/NTFT.py index 302bed9..7c61273 100644 --- a/NTFT.py +++ b/NTFT.py @@ -130,7 +130,7 @@ class NTFT: for y in xrange(psize[1]): for x in xrange(psize[0]): #read - c = self.Image[clamp(x, 0, w)][clamp(y, 0, h)] + c = self.Image[clamp(x, 0, w-1)][clamp(y, 0, h-1)] r = c >> 24 g = (c >> 16) & 0xFF b = (c >> 8 ) & 0xFF @@ -218,6 +218,8 @@ def ReadImage(path): #i.Image = ReadImage("NTFTtests/geh.png") #i.WriteFile("NTFTtests/geh.ntft") + + if __name__ == "__main__": print " == NTFT.py ==" print " == by pbsds =="