Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex

Notices

Reply
 
Thread Tools Search this Thread
Old 02-03-2010, 12:22 PM   #16
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
Quote:
Originally Posted by owl123 View Post
Does removing the mobipocket plugin mean there's no dictionary support anymore for PDFs? (DR1000S supports only mobipocket dictionaries.)
Just checked it. The dictionary lookup function is greyed out and inaccessible.

I'll test the plugin in the coming hours.
owl123 is offline   Reply With Quote
Old 02-03-2010, 12:32 PM   #17
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Quote:
Originally Posted by badbob001 View Post
Hopefully when irex brings out the update to the dr1000, they will have an on-device method to merge scribbles to pdf and that method can be used for other document types.
Merging scribbles with a format is very format specific, so if it works for one format, it can not easily be copied for another format. Pdf allows to add an extra 'segment' that contains extra data for a page, this can be used to 'merge' the annotations with the pdf (like done by xournal) as a sequence of line segments. For image one would need to create an extra image with the annotations and merge both. For every format a specific method needs to be created to view the annotations stand-alone.
Maybe iRex can also publish the code for the PC companion application, and add a framework for merging annotations so new mergers could easily be added by the user community.
Mackx is offline   Reply With Quote
Advert
Old 02-03-2010, 01:32 PM   #18
luite
Connoisseur
luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.
 
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
Quote:
Originally Posted by Mackx View Post
Merging scribbles with a format is very format specific, so if it works for one format, it can not easily be copied for another format. Pdf allows to add an extra 'segment' that contains extra data for a page, this can be used to 'merge' the annotations with the pdf (like done by xournal) as a sequence of line segments.
DjVu also supports annotations in text format, but those are mostly meant for creating hyperlinks ( see http://djvu.sourceforge.net/doc/man/djvused.html under 'Annotation Syntax' ). The type (line x0 y0 x1 y1) would probably be most useful, it has a width and a color. Maybe these hyperlinks can be abused for merging scribbles.

I don't do anything with those annotations at the moment, so unless djvulibre automatically renders the borders, this kind of annotations will not show up in the viewer. Does anyone know if any of the common djvu viewers for the pc show these annotations?

Last edited by luite; 02-03-2010 at 01:36 PM.
luite is offline   Reply With Quote
Old 02-03-2010, 03:29 PM   #19
tjdean256
Zealot
tjdean256 is on a distinguished road
 
Posts: 138
Karma: 70
Join Date: Jan 2009
Location: Louisiana
Device: irex dr1000s; Pocket edge
Mackx's port of Xournal to the DR1000 allows merging scribbles to PDF now.

td
tjdean256 is offline   Reply With Quote
Old 02-03-2010, 03:57 PM   #20
luite
Connoisseur
luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.
 
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
I have tested a few viewers and found out that both WinDjView 1.0.3 and DjView 4.6 support line annotations. The UDS plugin does not show them (yet?).

If you want to experiment with annotations, try this:
djvused myfile.djvu -e 'output-all' > annotations.dsed

open annotations.dsed, if you have a hidden text layer, you will see things like: select 'pagename.djvu' ... set-txt ... . Choose your favourite page and add the following lines below the line "select 'pagename.djvu'":
set-ant
(maparea "" "" (line 400 400 800 800))
.

now run:
djvused myfile.djvu -f annotations.dsed -s

and view your file in DjView 4.6

Last edited by luite; 02-03-2010 at 04:20 PM. Reason: oops, WinDjView does support line annotations
luite is offline   Reply With Quote
Advert
Old 02-03-2010, 05:33 PM   #21
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
Quote:
Originally Posted by luite View Post
Hmm, that is a problem. I'll look into this, possibly the next update.


It is a problem on both the actual device and the emulator. Opening a djvu file results in an error message: "'filename.djvu' cannot be opened"

Looking at the debug output of the emulator, these are the relevant error messages:
(ERROR)uds_plugin_manager.cpp:150,get_plugin_path( ) No matched plugin for .djvu
com.mobipocket.common.library.reader.InvalidBookEx ception: Corrupted
at com.mobipocket.common.library.reader.BookItem.<ini t>(libuds-plugin-mobipocket.so)
(ERROR)../plugin_impl/reader_impl.cpp:2302,get_error_code() This book is corrupted.
(ERROR)uds_doc_manager.cpp:149,open_document() Error opening document for /media/mmcblk0p1/test.djvu

After the first error, the plugin is queried (through IPluginLibrary) to check whether the document is supported. Even though the plugin tells UDS that the file is supported if its extension is .djvu or .djv, it still queries the mobipocket plugin afterwards.

I'm not sure what goes wrong, as both UDS and the mobipocket plugin are closed source. Perhaps I didn't implement some interface correctly.
I'm not into debugging or programming at all but maybe the mobipocket plugin is queried because both ebook formats supported natively by UDS (.mobi and .pdf) work with mobipocket dictionaries.

Maybe the mobipocket plugin returns "The book is corrupted error" because the dictionary function can't recognize the djvu format.
owl123 is offline   Reply With Quote
Old 02-03-2010, 07:54 PM   #22
luite
Connoisseur
luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.
 
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
Quote:
Originally Posted by owl123 View Post
I'm not into debugging or programming at all but maybe the mobipocket plugin is queried because both ebook formats supported natively by UDS (.mobi and .pdf) work with mobipocket dictionaries.

Maybe the mobipocket plugin returns "The book is corrupted error" because the dictionary function can't recognize the djvu format.
It seems to be extension dependent. If I remove libuds-plugin-pdf.so (the default PDF plugin) and rename my plugin to libuds-plugin-pdf.so and then open a renamed DjVu file (with .pdf extension), it will load just fine. Even when the mobipocket plugin is installed! It does not even ask the plugin whether the file format is supported.

I did some digging around in the uds executable (source code not available, unfortunately), and it seems to have a hardcoded map of extensions and plugins ( uds::PluginMgr::initialize_ext_table ).

The method uds::PluginMgr::create_document first calls uds::PluginMgr::get_plugin_path to check this map for one of the hardcoded extensions. Unknown extensions are handled by loading all plugins and checking them to see if the format is supported.

There may be something that goes wrong there.
luite is offline   Reply With Quote
Old 02-04-2010, 02:54 AM   #23
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
Is there a plugin for HTML or TXT that you could rename? Both of these formats aren't really usable with the native reader.
owl123 is offline   Reply With Quote
Old 02-04-2010, 03:02 AM   #24
Gertjan
ex-IRX developer
Gertjan doesn't litterGertjan doesn't litterGertjan doesn't litter
 
Gertjan's Avatar
 
Posts: 158
Karma: 224
Join Date: Oct 2008
Device: Irex DR800S, DR1000S, iLiad
Quote:
Originally Posted by luite View Post
The method uds::PluginMgr::create_document first calls uds::PluginMgr::get_plugin_path to check this map for one of the hardcoded extensions. Unknown extensions are handled by loading all plugins and checking them to see if the format is supported.

There may be something that goes wrong there.
That would be my guess too. I haven't checked, but I think the mobipocket plugin for some reason reports it can open the djvu file. When it actually opens the file, the plugin finds that it is not a valid Mobipocket.

You might be able to work around it by renaming the Mobipocket plugin so it is probed _after_ the DJVU plugin. In that case, opening Mobipocket files will take a bit longer as UDS has to check all plugins first.
Gertjan is offline   Reply With Quote
Old 02-04-2010, 03:48 AM   #25
thomega
Connoisseur
thomega began at the beginning.
 
Posts: 56
Karma: 22
Join Date: Oct 2008
Location: Würzburg, Germany
Device: iRex DR1000S
Quote:
Originally Posted by luite View Post
If you can render the scribbles for a single page to an image with the correct resolution, it should be fairly easy to do using imagemagick and djvulibre. [...] render scribbles for the page to an image file (own tool, does one already exist?)
Since the scribbles are most likely stored in the same formalt as for PDF files, it should be really easy to use my PDF scribble merger for rendering them on a blank page. The rest is a matter of GhostScript, ImageMagick and djvulibre. This could be slow, but should be straightforward.
thomega is offline   Reply With Quote
Old 02-04-2010, 07:55 AM   #26
luite
Connoisseur
luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.
 
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
Quote:
Originally Posted by Gertjan View Post
That would be my guess too. I haven't checked, but I think the mobipocket plugin for some reason reports it can open the djvu file. When it actually opens the file, the plugin finds that it is not a valid Mobipocket.

You might be able to work around it by renaming the Mobipocket plugin so it is probed _after_ the DJVU plugin. In that case, opening Mobipocket files will take a bit longer as UDS has to check all plugins first.
Unfortunately, that doesn't work. If I rename the mobipocket plugin, it will not load DjVu (same problem, caused by the mobipocket plugin) or MobiPocket (I think because it tries to use the hardcoded file name)
luite is offline   Reply With Quote
Old 02-04-2010, 08:34 AM   #27
luite
Connoisseur
luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.
 
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
Ok, I have found something. If you change the first 'if(x)' to 'if(!x)' in the loop after the load_all_plugins call in uds::PluginMgr::create_document you can load all files (tested mobipocket, pdf, djvu) correctly. (I don't have the source code, so it might look a little different of course )

I'm not sure if this is the real problem or that it's just a coincidence that this change just makes it work.

Last edited by luite; 02-04-2010 at 08:40 AM.
luite is offline   Reply With Quote
Old 02-05-2010, 04:55 PM   #28
luite
Connoisseur
luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.
 
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
I have tested the plugin for a few more days on my reader and haven't encountered any problems. I'd like to make a 0.2.0 update with a new installation method (no more schema overwriting) and that doesn't require removal of mobipocket support, but I need to know a few things for that. I hope someone (from irex?) can answer them:

- Is the fix I found for UDS 'correct' (see previous post, it's about uds in firmware version 1.7.1)? Or is there a better way to make it work?
- I noticed that the virtual machine does not load the content browser when uds is removed. If something goes wrong overwriting uds or other system files, is there still a way for end users to recover their firmware, without sending in the device?

after the basics are in place, the plugin could be improved/extended:
- support for table of contents, hyperlinks, text search
- better image rendering (libdjvulibre does a very simple bilinear resample to rescale the high resolution bitonal (black/white) images to a relatively low resolution screen size grayscale image, which makes the images slighly blurry. this could be improved, but obviously shouldn't take too much time. does anyone know a suitable algorithm that preserve edge sharpness but don't destroy readability of small characters?)

any other requests/suggestions?
luite is offline   Reply With Quote
Old 02-06-2010, 05:49 AM   #29
Gertjan
ex-IRX developer
Gertjan doesn't litterGertjan doesn't litterGertjan doesn't litter
 
Gertjan's Avatar
 
Posts: 158
Karma: 224
Join Date: Oct 2008
Device: Irex DR800S, DR1000S, iLiad
Quote:
Originally Posted by luite View Post
- Is the fix I found for UDS 'correct' (see previous post, it's about uds in firmware version 1.7.1)? Or is there a better way to make it work?
I don't know what happens there but it looks like your plugin reports that it uses a "high level" interface which is incorrect. If you provide source code of the plugin we can see what's going on.

Quote:
- If something goes wrong overwriting uds or other system files, is there still a way for end users to recover their firmware, without sending in the device?
The end user is always able to recover the device by re-installing a firmware update. In case the device does not start in the normal way, the update can be copied to the SD card directly. A hard reset of the device triggers the update process.
Gertjan is offline   Reply With Quote
Old 02-06-2010, 07:43 AM   #30
luite
Connoisseur
luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.luite has a complete set of Star Wars action figures.
 
Posts: 82
Karma: 256
Join Date: Feb 2010
Location: Netherlands
Device: dr1000
Thanks for the reply

Quote:
Originally Posted by Gertjan View Post
I don't know what happens there but it looks like your plugin reports that it uses a "high level" interface which is incorrect. If you provide source code of the plugin we can see what's going on.
I will clean up the source a little to make it ready for distribution. Like I said in the other thread, it is based on the pdf plugin (1.7.1 svnr4447), and the plugin_impl directory is almost unchanged. I only modified the file library_impl.cpp, to change the ".pdf" extension in g_ext_table to ".djvu".

Quote:
The end user is always able to recover the device by re-installing a firmware update. In case the device does not start in the normal way, the update can be copied to the SD card directly. A hard reset of the device triggers the update process.
Thanks, that makes me worry a little less about releasing things that copy files to system directories

By the way, I saw that the DR800's plugin interfaces have been (slightly) changed, will the new DR1000 firmware also use the new interfaces?
luite is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 07:56 AM.


MobileRead.com is a privately owned, operated and funded community.