mirror of
https://github.com/Kilian/Trimage.git
synced 2026-01-26 01:58:41 -05:00
Small fixes, debug print
This commit is contained in:
parent
a1811a0a74
commit
4fae39c67f
1 changed files with 3 additions and 3 deletions
|
|
@ -240,7 +240,7 @@ class Worker(QThread):
|
||||||
name = oldfile.fileName()
|
name = oldfile.fileName()
|
||||||
oldfilesize = oldfile.size()
|
oldfilesize = oldfile.size()
|
||||||
oldfilesizestr = size(oldfilesize, system=alternative)
|
oldfilesizestr = size(oldfilesize, system=alternative)
|
||||||
|
print type(filename)
|
||||||
# get extention
|
# get extention
|
||||||
baseName, extention = os.path.splitext(filename)
|
baseName, extention = os.path.splitext(filename)
|
||||||
|
|
||||||
|
|
@ -248,13 +248,13 @@ class Worker(QThread):
|
||||||
if extention in ['.jpg', '.jpeg']:
|
if extention in ['.jpg', '.jpeg']:
|
||||||
runString = 'jpegoptim -f --strip-all "%(file)s"'
|
runString = 'jpegoptim -f --strip-all "%(file)s"'
|
||||||
elif extention in ['.png']:
|
elif extention in ['.png']:
|
||||||
runString = 'optipng -force -o7 "%(file)s"; advpng -z4 "%(file)"'
|
runString = 'optipng -force -o7 "%(file)s"; advpng -z4 "%(file)s"'
|
||||||
else:
|
else:
|
||||||
# This probably should never happen...
|
# This probably should never happen...
|
||||||
raise Exception('File %s does not have the appropriate extention' % filename)
|
raise Exception('File %s does not have the appropriate extention' % filename)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
retcode = call(runString % {'file' : filename, shell = True, stdout = PIPE)
|
retcode = call(runString % {'file' : filename}, shell = True, stdout = PIPE)
|
||||||
runfile = retcode
|
runfile = retcode
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
runfile = e
|
runfile = e
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue