mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
f9419c9c3c
commit
235e3170e0
@ -76,15 +76,15 @@ def test_qt():
|
|||||||
print ('Qt OK!')
|
print ('Qt OK!')
|
||||||
|
|
||||||
def test_imaging():
|
def test_imaging():
|
||||||
from calibre.utils.magick.draw import create_canvas, Image
|
from calibre.ebooks import calibre_cover
|
||||||
im = create_canvas(20, 20, '#ffffff')
|
data = calibre_cover('test', 'ok')
|
||||||
jpg = im.export('jpg')
|
if len(data) > 1000:
|
||||||
Image().load(jpg)
|
print ('ImageMagick OK!')
|
||||||
im.export('png')
|
else:
|
||||||
print ('ImageMagick OK!')
|
raise RuntimeError('ImageMagick choked!')
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
i = Image.open(cStringIO.StringIO(jpg))
|
i = Image.open(cStringIO.StringIO(data))
|
||||||
if i.size != (20, 20):
|
if i.size < (20, 20):
|
||||||
raise RuntimeError('PIL choked!')
|
raise RuntimeError('PIL choked!')
|
||||||
print ('PIL OK!')
|
print ('PIL OK!')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user