mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Build test for Qt image format recognition
This commit is contained in:
parent
52e18ff800
commit
3224129dba
@ -127,7 +127,21 @@ def test_apsw():
|
|||||||
conn.close()
|
conn.close()
|
||||||
fprint('apsw OK!')
|
fprint('apsw OK!')
|
||||||
|
|
||||||
|
def test_image_formats():
|
||||||
|
# Must be run before QApplication is constructed
|
||||||
|
# Test that the image formats are available without a QApplication being
|
||||||
|
# constructed
|
||||||
|
from calibre.utils.img import image_from_data, image_to_data
|
||||||
|
data = I('blank.png', allow_user_override=False, data=True)
|
||||||
|
img = image_from_data(data)
|
||||||
|
image_from_data(P('catalog/mastheadImage.gif', allow_user_override=False, data=True))
|
||||||
|
for fmt in 'png bmp jpeg'.split():
|
||||||
|
d = image_to_data(img, fmt=fmt)
|
||||||
|
image_from_data(d)
|
||||||
|
|
||||||
|
|
||||||
def test_qt():
|
def test_qt():
|
||||||
|
test_image_formats()
|
||||||
from calibre.gui2 import Application
|
from calibre.gui2 import Application
|
||||||
from PyQt5.Qt import (QImageReader, QNetworkAccessManager, QFontDatabase)
|
from PyQt5.Qt import (QImageReader, QNetworkAccessManager, QFontDatabase)
|
||||||
from PyQt5.QtWebKitWidgets import QWebView
|
from PyQt5.QtWebKitWidgets import QWebView
|
||||||
|
Loading…
x
Reference in New Issue
Block a user