Thank you for this
MOST EXCELLENT software!
I have noticed only one bug so far: the gamma correction for DjVu files doesn't work (but works fine for PDF files). When you fix this I will be able to delete all those massive PDF files from my Kindle and replace them with equivalent DjVu files (about 10x smaller in size, pixel-by-pixel identical to PDF).
The test files showing the bug are here:
http://www.bibles.org.uk/testfile.zip
The pdf file works fine, but the djvu file ignores the setting of gamma. Actually, there seems to be no page redraw after pressing +/- keys for djvu (but there is for pdf).
I would say this is the second most-important program ever written for Kindle (the first one is CoolReader and the third one is Kindle Chess, of course).
-------
Ok, the above "gamma doesn't work" is a red herring. The real bug lies elsewhere and I think we have tracked it down, thanks to NuPogodi's excellent analysis of the real cause (on the "Russian forum", the-ebook.org)!
Namely, the problem is probably due to the hardcoded rendering mode of DDJVU_RENDER_COLOR in djvu.c:handle():
ddjvu_page_render(page->page_ref, DDJVU_RENDER_COLOR, &pagerect, &renderrect, pixelformat, bb->w, imagebuffer);
In a DjVu viewer for Hanlin V3 (Lbook V3) called libdjvu I set the rendering mode depending on whether the djvu file is bitonal or not:
if (page_type == DDJVU_PAGETYPE_BITONAL)
djvu_render_mode = DDJVU_RENDER_MASKONLY;
else
djvu_render_mode = DDJVU_RENDER_COLOR;
Please consider this. I don't have the environment (arm gcc, etc.) to test this at the moment. But if there are clear instructions on building kindlepdfviewer (I'll check the README) then perhaps I will try.
Anyway, if you (hawhill, the Author) have a spare minute to try and compile the above fix (page_type is returned by ddjvu_page_get_type(djvu_page)) and see if it fixes the problem (the testfile.zip contains everything necessary to test) it would be great.