From 42318c46b6803fff4e545446480fbcf810bda570 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Wed, 27 May 2020 13:16:43 +0100 Subject: [PATCH] Put the image bytes directly in code --- resources/images/blank-1x1.png | Bin 67 -> 0 bytes src/calibre/gui2/comments_editor.py | 7 ++++++- src/calibre/gui2/widgets2.py | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) delete mode 100644 resources/images/blank-1x1.png diff --git a/resources/images/blank-1x1.png b/resources/images/blank-1x1.png deleted file mode 100644 index 91a99b94e23a00cc8133f22e3fe2a0b48a015808..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}blE>9Q7kcv6UAQ@H$MqV!6EkIEQ MPgg&ebxsLQ07X&@0{{R3 diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index 34db3b65a4..79e9476f44 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -764,7 +764,12 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{ with lopen(path, 'rb') as f: data = f.read() except EnvironmentError: - return QByteArray(I('blank-1x1.png', data=True)) + return QByteArray(bytearray.fromhex( + '89504e470d0a1a0a0000000d49484452' + '000000010000000108060000001f15c4' + '890000000a49444154789c6300010000' + '0500010d0a2db40000000049454e44ae' + '426082')) else: return QByteArray(data) diff --git a/src/calibre/gui2/widgets2.py b/src/calibre/gui2/widgets2.py index 5aa6c9df59..9a02f188c4 100644 --- a/src/calibre/gui2/widgets2.py +++ b/src/calibre/gui2/widgets2.py @@ -489,7 +489,12 @@ class HTMLDisplay(QTextBrowser): with lopen(path, 'rb') as f: data = f.read() except EnvironmentError: - return QByteArray(I('blank-1x1.png', data=True)) + return QByteArray(bytearray.fromhex( + '89504e470d0a1a0a0000000d49484452' + '000000010000000108060000001f15c4' + '890000000a49444154789c6300010000' + '0500010d0a2db40000000049454e44ae' + '426082')) else: return QByteArray(data) else: