Made NTFT.py support non-square images and fixed two typos

This commit is contained in:
pbsds committed 2014-06-24 01:02:40 +02:00
1 parent a2d73dcc3c
commit dfd42b850f
2 files changed
+8 -6

No files matched your search

+7 -5
View File
@@ -115,8 +115,10 @@ class NTFT:
if not self.Loaded:
return False
w = len(self.Image[0])
h = len(self.Image)
h = len(self.Image[0])
w = len(self.Image)
print w, h
#the actual stored data is a image with the sizes padded to the nearest power of 2
psize = []
@@ -221,7 +223,7 @@ def ReadImage(path):
if __name__ == "__main__":
print " == NTFT.py =="
print " == by pbsds =="
print " == v0.73 =="
print " == v0.80 =="
print
if not hasPIL:
@@ -233,7 +235,7 @@ if __name__ == "__main__":
print " NTFT.py <input> [<output> [<width> <height>]]"
print ""
print "Can convert a NTFT to PNG or the other way around."
print "if <output> isn't spesified it will be set to <input> with an another extention"
print "if <output> isn't specified it will be set to <input> with an another extension"
print ""
print "The NTFT file contain only the colordata, so it's up to the user to find or"
print "store the resolution of the image. <width> and <height> is required"
@@ -261,7 +263,7 @@ if __name__ == "__main__":
width = int(sys.argv[3])
height = int(sys.argv[4])
if not (width and height):
if not (width and height) and not Encode:
print "Image size not provided!"
sys.exit()
+1 -1
View File
@@ -6,7 +6,7 @@
PPM.py: v1.2
PPM_nonumpy.py: v1.06
UGO.py: v0.92
NTFT.py: v0.73
NTFT.py: v0.80
--DESCRIPTION--
PPM.py can read the metadata, thumbnail, frames and the sound of Flipnote Studio files: .ppm