mirror of
https://github.com/Kilian/Trimage.git
synced 2026-01-26 10:08:40 -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
2
todo
2
todo
|
|
@ -28,7 +28,7 @@ todo app wise
|
||||||
- implement threading (and include advpng then)
|
- implement threading (and include advpng then)
|
||||||
- errors need to go to standarderror
|
- errors need to go to standarderror
|
||||||
- test with filenames in spaces (probably works already)
|
- test with filenames in spaces (probably works already)
|
||||||
|
- test differnt file name cases
|
||||||
|
|
||||||
todo else
|
todo else
|
||||||
- figure out dependencies for a .deb/how to make a .deb
|
- figure out dependencies for a .deb/how to make a .deb
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class StartQT4(QMainWindow):
|
||||||
print("booya")
|
print("booya")
|
||||||
|
|
||||||
def checkname(self, filename):
|
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
|
return True
|
||||||
|
|
||||||
def file_dialog(self):
|
def file_dialog(self):
|
||||||
|
|
@ -76,7 +76,7 @@ class StartQT4(QMainWindow):
|
||||||
images = fd.getOpenFileNames(self,
|
images = fd.getOpenFileNames(self,
|
||||||
"Select one or more image files to compress",
|
"Select one or more image files to compress",
|
||||||
"", # directory
|
"", # directory
|
||||||
"Image files (*.png *.jpg)")
|
"Image files (*.png *.jpg *.jpeg)")
|
||||||
for image in images:
|
for image in images:
|
||||||
if self.checkname(image):
|
if self.checkname(image):
|
||||||
self.compress_file(image)
|
self.compress_file(image)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue