02-07-2010, 02:07 PM | #31 |
Connoisseur
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
|
Here are the sources for the djvu plugin. I basically copied the pdf plugin (from firmware version 1.7) and reimplemented just enough of the poppler API with djvulibre to make it work with the rest of the plugin (the new files are src/pdf_doc.cpp and inc/pdf_doc.h ).
I haven't changed the names of the files or classes. Most files are unchanged, and the changes in the other files are small (changing ".pdf" extension to ".djvu", poppler includes to "pdf_doc.h"). The source is slighly different from the last (0.1.3) binary release. I also removed the dependency on poppler and included only the 'goo' library. This should make it easier to port to the dr800 and the upcoming dr1000 firmware that will use the adobe pdf viewer instead of poppler. |
02-07-2010, 10:04 PM | #32 | |
Connoisseur
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
|
Quote:
But how exactly does uds determine whether a plugin uses the high or the low level interface? I have searched all documentation and the document-viewer-plugins source code, and tried tracing through the relevant functions in the debugger (uds::PluginMgr::create_wrapper_library seemed relevant) but haven't been able to find out. |
|
Advert | |
|
02-09-2010, 01:42 PM | #33 |
Connoisseur
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
|
Isn't there anyone who can answer this? It's rather difficult to find out these things without source code or documentation. Perhaps I should ask on the irex forum instead? I really want my plugin to behave correctly before the next update.
By the way, I've been working on adding text search. It's not done yet and I'll be rather busy for the next few weeks, but it is coming |
02-10-2010, 09:57 AM | #34 | |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
Quote:
If I look at the differences between the image-plugin and pdf-plug and look at the functionality for which mobipocket might be used. Then I suspect the following call: g_instances_table.add_interface<IPluginDocMarker>( this); in document_impl.cpp. I am not sure if this interface is also needed for search functionality. Note: this is only a guess |
|
02-10-2010, 12:05 PM | #35 | |
Connoisseur
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
|
Quote:
The IPluginDocMarker interface seems to be used for the table of contents and bookmarks and doesn't seem relevant for the decision whether the plugin uses the high or the low level interface. All interface objects are accessed through an IPluginUnknown query_interface call, implemented in plugin_impl/library_impl.cpp. The only interface actually queried is IPluginLibrary, so I think uds doesn't know about the other interfaces supported by the plugin, at this stage. The IPluginLibrary interface has three methods: create_document (for the low level interface), create_reader (for the high level interface) and is_supported_document. Of these, only is_supported_document is called by uds before it goes wrong. is_supported_document returns PLUGIN_TRUE if the file has a .djvu extension. The comments in the IPluginLibrary header file are the only references to the high and low level interfaces I could find, but there isn't any information about when either of them is used. I have tried to set the function pointer of create_reader explicitly to 0 (NULL), but that didn't seem to help. |
|
Advert | |
|
02-11-2010, 06:29 AM | #36 |
Connoisseur
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
|
Just a small update: I got the search function working. The code is still quite messy, and I still need to check if I properly allocate and free memory everywhere (ahh, the curse of C++), but it will probably be included in the next update. (after the mobipocket issue is resolved)
|
02-11-2010, 07:18 AM | #37 |
Addict
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
|
Great news, luite! Can't wait to get it.
|
02-11-2010, 01:45 PM | #38 |
Connoisseur
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
|
I hope to upload it soon, unfortunately the iRex guys here don't seem to be in such a hurry to provide the information about the interfaces.
The text search seems to work fine now, I found the source of the memory leak and fixed it. Dictionary lookup also works (but only with my unofficially patched uds). I now want to add outline (table of contents) support to the plugin, but I can't find a djvu file with a table of contents on archive.org. Can anyone provide one or a few files with a good table of contents? (no illegal files please) If you are unsure, you can check your file with djvused from djvulibre: djvused -e print-outline filename.djvu |
02-11-2010, 02:58 PM | #39 | |
ex-IRX developer
Posts: 158
Karma: 224
Join Date: Oct 2008
Device: Irex DR800S, DR1000S, iLiad
|
Quote:
I hope you understand that, although we're willing, we have limited resources to support community efforts. We don't want to delay all those wonderful new features we're working on. |
|
02-11-2010, 05:12 PM | #40 | ||
Connoisseur
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
|
Quote:
tar -xzvf djvulibre-3.5.22.tar.gz cd djvulibre-3.5.22 ./configure --host=arm-poky-linux-gnueabi --prefix=/usr make make install DESTDIR=/home/user/djvulibre cd /home/user/djvulibre tar -czf djvulibre-dr1000-bin.tar.gz usr if you have installed the poky toolchain in the location described in the documentation, install with: sudo tar -xzvf djvulibre-dr1000-bin.tar.gz -C /usr/local/poky/eabi-glibc/arm/arm-poky-linux-gnueabi/ then compiled the plugin using: tar -xzvf djvu-plugin-src-0.1.4pre.tar.gz cd djvu-plugin autoreconf --install ./configure --host=arm-poky-linux-gnueabi --enable-debug make This does result in some error about creating libuds-plugin-djvu.la, because there seems to be something wrong with the location of libjpeg in /usr/local/poky/eabi-glibc/arm/arm-poky-linux-gnueabi/usr/lib/libdjvulibre.la. The .so file is created anyway, so I didn't bother to fix this. the directory plugin_impl/.libs should contain the required libuds-plugin-djvu.so now. I haven't tested 'make install' functionality for the plugin, because my own scripts directly copy this file to /usr/lib/uds in the emulator. If you have run the installer script from binary release 0.1.3, you should have the other required files on the emulator already. I hope this is what you need. Note that this is all built using the 1.7 SDK and emulator. The interfaces for the DR800 (and possibly the latest DR1000 firmware as well) are slightly different, so it will probably not load if you use a newer version. Quote:
By the way, my guess is that if you remove .pdf from the hardcoded extensions in uds, it will also try to load the pdf plugin using this code path and it will fail in exactly the same way. It's just a guess, but you may not need to compile the djvu plugin after all to see what is wrong. |
||
02-12-2010, 10:06 AM | #41 |
ex-IRX developer
Posts: 158
Karma: 224
Join Date: Oct 2008
Device: Irex DR800S, DR1000S, iLiad
|
Thanks Luite. I happened to have tried with a slightly earlier version of djvulibre which appears to be broken. Now that I got it running, I found that the cause of the loading issue is, unfortunately, a bug in UDS (v1.5~v1.7).
When the Mobipocket plugin is loaded before the DJVU plugin, this accidentally leaves the 'high level interface' bit set and opening a file will fail because of this. As the plugins are loaded in the order that they appear on the file system, DJVU is likely to be the last since it is added later. You might try to work out a way around this by fiddling with the Mobipocket plugin file to make it appear _after_ the DJVU plugin in the file system. Sorry I can't be more helpful. |
02-12-2010, 12:31 PM | #42 |
Connoisseur
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
|
Thanks Gertjan for verifying this. I'll see if I can work around it somehow. Perhaps by overwriting UDS with a patched version (I already have one that I used for testing dictionary lookups on the emulator), after checking the firmware version of course.
|
02-13-2010, 02:19 PM | #43 |
Connoisseur
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
|
Table of contents support is done now, only supports absolute page numbers at the moment (so no image file names). I still need to do a little more testing on my reader.
I have tested the search function the last few days and it seems to work fine. Rotated pages are also supported now (annoyingly, djvulibre automatically rotates page images that have the rotation flag set, but it doesn't move the bounding boxes for the words accordingly. The bouding boxes are used for highlighting search words and for dictionary lookup). Next update soon (I'll probably open a new topic because this one is mostly about the uds problems now, and bump the version number to 0.2.0, because of the changed installation scripts) |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DjVu Plugin for DR1000 - version 0.2 | luite | iRex | 30 | 10-18-2010 03:49 PM |
Beta testers wanted | mtravellerh | PocketBook | 47 | 09-15-2010 04:22 PM |
Wanted: DjVu Plugin for DR800 | martienne | iRex | 14 | 06-07-2010 05:57 PM |
Beta testers wanted: MobileRead goes Unicode | Alexander Turcic | Announcements | 0 | 08-12-2009 10:28 AM |