mirror of
https://github.com/Kilian/Trimage.git
synced 2026-01-26 01:58:41 -05:00
update checkname function to be better
This commit is contained in:
parent
adbdf15fe9
commit
94613d658d
2 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue