pgaskin / dictutil

Tools, documentation, and libraries related to Kobo dictionaries.
https://pgaskin.net/dictutil
MIT License
58 stars 4 forks source link

Nickel image bugs #1

Closed pgaskin closed 4 years ago

pgaskin commented 4 years ago

All methods of loading images currently have bugs in nickel (not dictutil), with the exception of base64-encoded images in the full-screen dictionary search.

pgaskin commented 4 years ago

https://github.com/geek1011/dictutil/commit/b403da2f458d50ebb45a3c52c2dd126be030c64d#commitcomment-37414958


I think I've found a bug in the way nickel handles images in the in-book dictionary view (the search view is fine) which causes it to segfault in some cases. I'm going to see if I can work around this one or patch it out. If not, I'll disable support for images by default.

OH THE HUMANITY!
pid: 176, tid: 176 (nickel), rev: bf36b8c11a1ed01c527b80c14d20d9de5383d729
  >>> /usr/local/Kobo/nickel <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000009c
 r0 034cec28  r1 00000002  r2 039b66f8  r3 00000000
 r4 04070000  r5 0000006c  r6 7eb942b8  r7 7eb94288
 r8 039b66f8  r9 00000000  10 7eb942bc  fp 7eb942b4
 ip 76bd5d34  sp 7eb94288  lr 762fc187  pc 73761d8a  cpsr 00070030
    #00 sp: 0x7eb94288 ip: 0x73761d8a  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtNetwork.so.4.6.2: _ZN21QNetworkAccessManager3getERK15QNetworkRequest+0xd
    #01 sp: 0x7eb94298 ip: 0x762fc187  /usr/local/Kobo/libnickel.so.1.0.0: _ZNK10DebugStyle11drawControlEN6QStyle14ControlElementEPK12QStyleOptionP8QPainterPK7QWidget+0x1386
    #02 sp: 0x7eb94300 ip: 0x73761d8f  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtNetwork.so.4.6.2: _ZN21QNetworkAccessManager3getERK15QNetworkRequest+0x12
    #03 sp: 0x7eb94310 ip: 0x7431f399  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x28572c
    #04 sp: 0x7eb94358 ip: 0x7431f4cf  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x285862
    #05 sp: 0x7eb94390 ip: 0x7431ce19  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x2831ac
    #06 sp: 0x7eb943c0 ip: 0x7431d9e3  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x283d76
    #07 sp: 0x7eb943f8 ip: 0x7431e28f  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x284622
    #08 sp: 0x7eb94428 ip: 0x7431ab55  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x280ee8
    #09 sp: 0x7eb94470 ip: 0x7427d135  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x1e34c8
    #10 sp: 0x7eb944b8 ip: 0x74190bff  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xf6f92
    #11 sp: 0x7eb944e8 ip: 0x7419355b  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xf98ee
    #12 sp: 0x7eb94518 ip: 0x741937bd  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xf9b50
    #13 sp: 0x7eb94540 ip: 0x74157f5d  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xbe2f0
    #14 sp: 0x7eb94658 ip: 0x7415fc77  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xc600a
    #15 sp: 0x7eb94718 ip: 0x74160059  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xc63ec
    #16 sp: 0x7eb94770 ip: 0x74182589  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xe891c
    #17 sp: 0x7eb94978 ip: 0x7492aced  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x891080
    #18 sp: 0x7eb949a0 ip: 0x74b32fc3  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xa99356
    #19 sp: 0x7eb949c8 ip: 0x74b325c7  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xa9895a
    #20 sp: 0x7eb949f0 ip: 0x741183b7  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x7e74a
    #21 sp: 0x7eb94a20 ip: 0x7413614f  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x9c4e2
    #22 sp: 0x7eb94a98 ip: 0x74136df7  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x9d18a
    #23 sp: 0x7eb94af8 ip: 0x741379e7  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x9dd7a
    #24 sp: 0x7eb94b18 ip: 0x7413a4ff  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xa0892
    #25 sp: 0x7eb94b40 ip: 0x7411ad45  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x810d8
    #26 sp: 0x7eb94bb8 ip: 0x7411b177  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x8150a
    #27 sp: 0x7eb94c30 ip: 0x7411bfdf  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0x82372
    #28 sp: 0x7eb94ca0 ip: 0x74af9dd5  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xa60168
    #29 sp: 0x7eb94cc0 ip: 0x74162b91  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xc8f24
    #30 sp: 0x7eb94d10 ip: 0x74052651  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZN23DumpRenderTreeSupportQt16addURLToRedirectERK7QStringS2_+0x304c
    #31 sp: 0x7eb94d48 ip: 0x74163b5d  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xc9ef0
    #32 sp: 0x7eb94d68 ip: 0x741640bf  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xca452
    #33 sp: 0x7eb94dd0 ip: 0x74166735  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xccac8
    #34 sp: 0x7eb94e38 ip: 0x74161cc5  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xc8058
    #35 sp: 0x7eb94f48 ip: 0x741657d5  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xcbb68
    #36 sp: 0x7eb95198 ip: 0x74176453  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xdc7e6
    #37 sp: 0x7eb951c8 ip: 0x74176483  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xdc816
    #38 sp: 0x7eb951e8 ip: 0x7418a965  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xf0cf8
    #39 sp: 0x7eb95398 ip: 0x74176947  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xdccda
    #40 sp: 0x7eb95478 ip: 0x74176fbb  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xdd34e
    #41 sp: 0x7eb95498 ip: 0x741774bd  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZSt4swapIN8QVariant7PrivateEEvRT_S3_+0xdd850
    #42 sp: 0x7eb956a0 ip: 0x74065d43  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWebKit.so.4.6.2: _ZN16QWebFrameAdapter7setHtmlERK7QStringRK4QUrl+0x29a
    #43 sp: 0x7eb95970 ip: 0x764804f5  /usr/local/Kobo/libnickel.so.1.0.0: _ZN14DictionaryView11setContentsERK7QStringRK4QUrl+0x2c
    #44 sp: 0x7eb95998 ip: 0x76481bf1  /usr/local/Kobo/libnickel.so.1.0.0: _ZN20InlineDictionaryView13gotDefinitionERK7QStringS2_RK4QUrl+0x88
    #45 sp: 0x7eb959f0 ip: 0x731f7075  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtCore.so.4.6.2: _ZN11QMetaObject8activateEP7QObjectiiPPv+0x1dc
    #46 sp: 0x7eb95aa0 ip: 0x767d150d  /usr/local/Kobo/libnickel.so.1.0.0: _ZN18DictionaryProvider13gotDefinitionERK7QStringS2_RK4QUrl+0x20
    #47 sp: 0x7eb95ac8 ip: 0x762fc671  /usr/local/Kobo/libnickel.so.1.0.0: _ZN18DictionaryProvider13getDefinitionERK7QString+0x74
    #48 sp: 0x7eb95af8 ip: 0x7647fe75  /usr/local/Kobo/libnickel.so.1.0.0: _ZN14DictionaryView8showWordERK7QString+0xf4
    #49 sp: 0x7eb95b30 ip: 0x76483515  /usr/local/Kobo/libnickel.so.1.0.0: _ZN20InlineDictionaryView8showWordERK7QString+0xa0
    #50 sp: 0x7eb95b58 ip: 0x766144ad  /usr/local/Kobo/libnickel.so.1.0.0: _ZN19SelectionController13getDefinitionEv+0x58
    #51 sp: 0x7eb95c18 ip: 0x76615a37  /usr/local/Kobo/libnickel.so.1.0.0: _ZN19SelectionController16handleTapGestureEP10TapGesture+0x96
    #52 sp: 0x7eb95c38 ip: 0x765f0673  /usr/local/Kobo/libnickel.so.1.0.0: _ZN11ReadingView10processTapEP10TapGesture+0x2a
    #53 sp: 0x7eb95cb0 ip: 0x76842b19  /usr/local/Kobo/libnickel.so.1.0.0: _ZN11ReadingView13backRequestedEv+0x72c
    #54 sp: 0x7eb95d00 ip: 0x731f7369  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtCore.so.4.6.2: _ZN11QMetaObject8activateEP7QObjectiiPPv+0x4d0
    #55 sp: 0x7eb95db0 ip: 0x76844685  /usr/local/Kobo/libnickel.so.1.0.0: _ZN15KepubBookReader10processTapEP10TapGesture+0x24
    #56 sp: 0x7eb95dd0 ip: 0x765f559d  /usr/local/Kobo/libnickel.so.1.0.0: _ZN15KepubBookReader10tapGestureEP15GestureReceiverP10TapGesture+0x1c
    #57 sp: 0x7eb95df0 ip: 0x762fde9b  /usr/local/Kobo/libnickel.so.1.0.0: _ZN15GestureReceiver21sendGestureToDelegateEP13QGestureEventP15GestureDelegate+0xd6
    #58 sp: 0x7eb95e10 ip: 0x73b5cb63  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWidgets.so.4.6.2: _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0x56
    #59 sp: 0x7eb95e28 ip: 0x73b62569  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWidgets.so.4.6.2: _ZN12QApplication6notifyEP7QObjectP6QEvent+0xff0
    #60 sp: 0x7eb95f88 ip: 0x76573f5d  /usr/local/Kobo/libnickel.so.1.0.0: _ZN18Nickel3Application6notifyEP7QObjectP6QEvent+0x34
    #61 sp: 0x7eb95fb8 ip: 0x731d6269  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtCore.so.4.6.2: _ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x84
    #62 sp: 0x7eb95fe8 ip: 0x73b983b5  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWidgets.so.4.6.2: _ZN18QGestureRecognizer20unregisterRecognizerEN2Qt11GestureTypeE+0x3224
    #63 sp: 0x7eb960b8 ip: 0x73b991f7  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWidgets.so.4.6.2: _ZN18QGestureRecognizer20unregisterRecognizerEN2Qt11GestureTypeE+0x4066
    #64 sp: 0x7eb96180 ip: 0x73b99ad5  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWidgets.so.4.6.2: _ZN18QGestureRecognizer20unregisterRecognizerEN2Qt11GestureTypeE+0x4944
    #65 sp: 0x7eb961c8 ip: 0x73b61619  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWidgets.so.4.6.2: _ZN12QApplication6notifyEP7QObjectP6QEvent+0xa0
    #66 sp: 0x7eb96328 ip: 0x76573f5d  /usr/local/Kobo/libnickel.so.1.0.0: _ZN18Nickel3Application6notifyEP7QObjectP6QEvent+0x34
    #67 sp: 0x7eb96358 ip: 0x731d6269  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtCore.so.4.6.2: _ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x84
    #68 sp: 0x7eb96388 ip: 0x73b6399f  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWidgets.so.4.6.2: _ZN19QApplicationPrivate22translateRawTouchEventEP7QWidgetP12QTouchDeviceRK5QListIN11QTouchEvent10TouchPointEEm+0x996
    #69 sp: 0x7eb96448 ip: 0x73ba7751  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWidgets.so.4.6.2: _ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE+0x2e38
    #70 sp: 0x7eb964c8 ip: 0x73b5cb63  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWidgets.so.4.6.2: _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0x56
    #71 sp: 0x7eb964e0 ip: 0x73b6199b  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtWidgets.so.4.6.2: _ZN12QApplication6notifyEP7QObjectP6QEvent+0x422
    #72 sp: 0x7eb96640 ip: 0x76573f5d  /usr/local/Kobo/libnickel.so.1.0.0: _ZN18Nickel3Application6notifyEP7QObjectP6QEvent+0x34
    #73 sp: 0x7eb96670 ip: 0x731d6269  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtCore.so.4.6.2: _ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x84
    #74 sp: 0x7eb966a0 ip: 0x73450589  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtGui.so.4.6.2: _ZN22QGuiApplicationPrivate17processTouchEventEPN29QWindowSystemInterfacePrivate10TouchEventE+0xe24
    #75 sp: 0x7eb96808 ip: 0x73452081  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtGui.so.4.6.2: _ZN22QGuiApplicationPrivate24processWindowSystemEventEPN29QWindowSystemInterfacePrivate17WindowSystemEventE+0x18c
    #76 sp: 0x7eb96840 ip: 0x73440887  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtGui.so.4.6.2: _ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x1e
    #77 sp: 0x7eb96850 ip: 0x71c86347  /usr/local/Kobo/platforms/libkobo.so: _ZN13QFontEngineFT19alphaRGBMapForGlyphEj6QFixedRK10QTransform+0xf3a
    #78 sp: 0x7eb96860 ip: 0x731d4bab  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtCore.so.4.6.2: _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0xe6
    #79 sp: 0x7eb96898 ip: 0x731d9a89  /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtCore.so.4.6.2: _ZN16QCoreApplication4execEv+0x58
    #80 sp: 0x7eb968c8 ip: 0x0001dca3  /usr/local/Kobo/nickel: main+0xc66
    #81 sp: 0x7eb96a90 ip: 0x71ed9335  /lib/libc-2.11.1.so: __libc_start_main+0x9c
    #82 sp: 0x7eb96bd8 ip: 0x0001e1fd  /usr/local/Kobo/nickel: _start+0x20

Of interest:

pgaskin commented 4 years ago

https://github.com/geek1011/dictutil/commit/b403da2f458d50ebb45a3c52c2dd126be030c64d#commitcomment-37423590


I've narrowed down the issue a bit further (with https://github.com/geek1011/kobo-mods/tree/master/dictbug-trace).

It seems that when in the in-book dictionary, if any URL scheme (e.g. http, data) is referenced other than dict, it will segfault. I haven't figured out the exact cause yet, but I suspect it's due to an invalid pointer in a Qt signal callback or a threading issue with the UI. It should be possible to patch it if needed, though.

For the bug with dict:/// URLs which causes the dictionary view to appear blank when an image is loaded, the cause is a bit unclear, but I'm planning to see if I can figure it out.

Hopefully, @gtalusan could get either one of these bugs to be fixed...

pgaskin commented 4 years ago

https://github.com/geek1011/dictutil/commit/b403da2f458d50ebb45a3c52c2dd126be030c64d#commitcomment-37423814


I've discovered something somewhat interesting. Even if a dict:/// image is loaded in an iframe, the entire definition will still appear blank (i.e. if any dict:/// url is loaded, the dictionary webview will be blanked). I'm probably going to see if the webview still has any content at all internally.

Also, I'm probably going to disable images by default in dictutil, and prefer the dict:/// method over base64 due to the segfaults. That way, I can write a patch which fixes the dict:/// stuff (if I can figure out the cause), and even if it isn't applied, dictionaries won't cause unexpected segfaults (entries with images will just appear blank).

Update: The entire contents of the webview (and maybe even the webview itself) are removed when loading a dict:/// URL.

pgaskin commented 4 years ago

https://github.com/geek1011/dictutil/commit/b403da2f458d50ebb45a3c52c2dd126be030c64d#commitcomment-37423814


I've made a bit more progress with the dict:/// blanking. It seems that when loading an HTML file (rather than an image) in an img tag as the src, the webview doesn't get wiped (and an invalid image question mark shows). Therefore, the bug isn't in the image loading (as in loading the file from the dictzip -- other existing files load fine without blanking), but rather, in the image rendering (but the confusing thing is, why doesn't it affect base64 or remote images in the same way ... it's possible that the image is being loaded incorrectly, and that rendering that specific corrupt image blanks the webview). Also, it eliminates the possibility that the webview is just getting replace with the last loaded file from the dictionary.

pgaskin commented 4 years ago

I'm planning to disable image support by default, at least for the first version of dictutil.

pgaskin commented 4 years ago

For anyone who wants to play around with this, here's a build of the current dictbug-trace (commit 9bf3dac) dictionary (dictutil pack -o dicthtml-bt.zip ~/src/kobo-mods/dictbug-trace/dicthtml): dicthtml-bt.zip.

I haven't documented the different words, but it should be pretty obvious when looking at the source files here. The following words are defined (the reason for the random words is to make it easier to try out the dictionary in actual books):

and
base64
but
embed
embed-hidden
if
iframe
that
the
then
they
url
pgaskin commented 4 years ago

Images have been mostly fixed in 4.20.14601:

I'll be updating the docs and making another alpha release with base64 images enabled by default later.

pgaskin commented 4 years ago

I'm going to close this issue for now, as there is now a working method for including images.

If the bug with dict:/// URLs happens to be fixed, I will update this issue and make it the default method.

pgaskin commented 4 years ago

v0.0.1-alpha.4 has been released with images enabled by default.