Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Dec 22, 2015
1 parent 67e82c2 commit ab11e8f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/calibre/utils/img.py
Expand Up @@ -159,6 +159,7 @@ def encode_jpeg(file_path, quality=80):
def test():
from calibre.ptempfile import TemporaryDirectory
from calibre import CurrentDir
from glob import glob
with TemporaryDirectory() as tdir, CurrentDir(tdir):
shutil.copyfile(I('devices/kindle.jpg'), 'test.jpg')
ret = optimize_jpeg('test.jpg')
Expand All @@ -171,3 +172,5 @@ def test():
ret = optimize_png('test.png')
if ret is not None:
raise SystemExit('optimize_png failed: %s' % ret)
if glob('*.bak'):
raise SystemExit('Spurious .bak files left behind')

0 comments on commit ab11e8f

Please sign in to comment.