diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py index 1780f01659..3f2e193401 100644 --- a/src/calibre/test_build.py +++ b/src/calibre/test_build.py @@ -127,7 +127,21 @@ def test_apsw(): conn.close() 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(): + test_image_formats() from calibre.gui2 import Application from PyQt5.Qt import (QImageReader, QNetworkAccessManager, QFontDatabase) from PyQt5.QtWebKitWidgets import QWebView