mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Image compression: Fix spurious zero byte .bak files being created when compressing png images inside epub files
Works around bug in optipng
This commit is contained in:
parent
c98dc668ef
commit
67e82c25e1
@ -125,6 +125,11 @@ def run_optimizer(file_path, cmd, as_filter=False, input_data=None):
|
|||||||
except EnvironmentError as err:
|
except EnvironmentError as err:
|
||||||
if err.errno != errno.ENOENT:
|
if err.errno != errno.ENOENT:
|
||||||
raise
|
raise
|
||||||
|
try:
|
||||||
|
os.remove(outfile + '.bak') # optipng creates these files
|
||||||
|
except EnvironmentError as err:
|
||||||
|
if err.errno != errno.ENOENT:
|
||||||
|
raise
|
||||||
|
|
||||||
def optimize_jpeg(file_path):
|
def optimize_jpeg(file_path):
|
||||||
exe = get_exe_path('jpegtran')
|
exe = get_exe_path('jpegtran')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user