Cleaned up comments and spacing.

This commit is contained in:
2020-08-23 00:42:23 -04:00
parent 909442ae32
commit d749cb2e96

View File

@@ -50,7 +50,7 @@ class MangaReader:
self.panel.pack() self.panel.pack()
def open_menu(self): def open_menu(self):
# file dialog. reset page counts, call display Maanga passing in starting values # file dialog. reset page counts, call display Manga passing in starting values
mangaFile = filedialog.askopenfilename() mangaFile = filedialog.askopenfilename()
self.file = mangaFile self.file = mangaFile
self.page = 0 self.page = 0
@@ -70,6 +70,7 @@ class MangaReader:
data = zip.read(fl[pg]) data = zip.read(fl[pg])
im = Image.open(io.BytesIO(data)) im = Image.open(io.BytesIO(data))
# I found the below code to maintain image ratios at https://stackoverflow.com/questions/273946/how-do-i-resize-an-image-using-pil-and-maintain-its-aspect-ratio
wpercent = (basewidth / float(im.size[0])) wpercent = (basewidth / float(im.size[0]))
hsize = int((float(im.size[1]) * float(wpercent))) hsize = int((float(im.size[1]) * float(wpercent)))
@@ -102,7 +103,6 @@ class MangaReader:
print(self.page) print(self.page)
print("FUCCK YOU") print("FUCCK YOU")
# initalize tk # initalize tk
root=Tk() root=Tk()
app = MangaReader(root) app = MangaReader(root)