diff --git a/todo b/todo index fd215da..93c132f 100644 --- a/todo +++ b/todo @@ -28,7 +28,7 @@ todo app wise - implement threading (and include advpng then) - errors need to go to standarderror - test with filenames in spaces (probably works already) - +- test differnt file name cases todo else - figure out dependencies for a .deb/how to make a .deb diff --git a/trimage.py b/trimage.py index d48603a..071c5e8 100644 --- a/trimage.py +++ b/trimage.py @@ -68,7 +68,7 @@ class StartQT4(QMainWindow): print("booya") def checkname(self, filename): - if filename.endsWith("png") or filename.endsWith("jpg"): + if os.path.splitext(filename)[1].lower() in ["jpg", "jpeg", "png"]: return True def file_dialog(self): @@ -76,7 +76,7 @@ class StartQT4(QMainWindow): images = fd.getOpenFileNames(self, "Select one or more image files to compress", "", # directory - "Image files (*.png *.jpg)") + "Image files (*.png *.jpg *.jpeg)") for image in images: if self.checkname(image): self.compress_file(image)