update checkname function to be better

This commit is contained in:
Kilian Valkhof 2010-02-02 20:57:08 +01:00
parent adbdf15fe9
commit 94613d658d
2 changed files with 3 additions and 3 deletions

2
todo
View file

@ -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

View file

@ -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)