I can confirm that special characters in filenames give also problems with unpacking. I uploaded a file at http://www.theochem.ru.nl/~dtanis/fi...Schilderij.cbr which give unpack problems because filenames contains a greek char beta. The problem lies in the unrar executable. When I extract the file manually I get the error: Cannot create 00 <square char>ou.jpg. I hope you are able to fix this problem otherwise I have to rename all the jpeg's of these of albums.

Thanks for the example file. I'll look at this later tonight.

Edit: The cbr file unpacks without problem on my Linux desktop machine, so I suspect it is a problem with creating files in the FAT filesystem on the reader. If the expanded files aren't too large, then maybe I can unpack them in the /tmp directory in such cases.

I've found that filenames with non-ASCII characters can be unpacked successfully in the /tmp directory (rather than the FAT filesystems where the ebooks are stored). So, I added a configuration option to enable/disable this behaviour. You have to open a non-problematic archive file to access the configuration options (otherwise the program kicks you out without any chance of changing options), then set the option to use /tmp for unpacking to "On". You should be able to open the problematic archives after that.

The disadvantage of using /tmp is that it is limited to 128 MB, so really big archives will probably fail when space runs out on that device.

Hopefully, this problem will go away when we change the program to unpack the images one at a time via internal library code rather than all at once via external commands. But that could take a while before it gets done.

I've updated the attached zip files in the first message in this thread with this new version. You only have to copy the new pbimageviewer.app program over; unzip and unrar haven't changed.

I've found that filenames with non-ASCII characters can be unpacked successfully in the /tmp directory (rather than the FAT filesystems where the ebooks are stored).

Quite strange. I can make directories or files on my Pocketbook with poterm and pi (editor) with non-ASCII filenames without any problems on the FAT-formatted discs. Looks like unrar uses other calls to create files.

Quote:

Originally Posted by rkomar

The disadvantage of using /tmp is that it is limited to 128 MB, so really big archives will probably fail when space runs out on that device.

Good enough for me. Most comics in my collection are about 20~40MB, and now I don't require some free space on my mSD-card too. Nice.

Quote:

Originally Posted by rkomar

Hopefully, this problem will go away when we change the program to unpack the images one at a time via internal library code rather than all at once via external commands. But that could take a while before it gets done.

I thought the FW has zlib on board, so you should be able to unpack files from zip-files directly into memory.

Thanks again for the fast fix. I have a request though. I read some manga and it would be nice if could open a dictionary in imageviewer the same way as in Adobe Reader or FB2-Reader. So I can retype the Japanese word from the image to find the meaning of the unknown word.

I thought the FW has zlib on board, so you should be able to unpack files from zip-files directly into memory.

Thanks again for the fast fix. I have a request though. I read some manga and it would be nice if could open a dictionary in imageviewer the same way as in Adobe Reader or FB2-Reader. So I can retype the Japanese word from the image to find the meaning of the unknown word.

zlib doesn't work directly with zip files, you need some more code on top of it. libzip seems to be nice to work with, and builds easily with the cross compiler, so I'll have a go with it. librar doesn't look to be anywhere near as easy to work with, unfortunately.

I've never tried coding a dictionary into a program. If it's straight-forward, I'll put it in. Free buttons are in short supply, though. Is it okay to open it with the menu, or would something like a long press on the OK or MENU button be better?

zlib doesn't work directly with zip files, you need some more code on top of it. libzip seems to be nice to work with, and builds easily with the cross compiler, so I'll have a go with it.

Ok, nice. I'll hope it will be easily implemented.

Quote:

Originally Posted by rkomar

librar doesn't look to be anywhere near as easy to work with, unfortunately.

And what about the 7zip library? 7zip can uncompress rar files but the unrar code is seperated from the main progam. and I don't know if they also supply the source code of that unrar library.

Quote:

Originally Posted by rkomar

I've never tried coding a dictionary into a program. If it's straight-forward, I'll put it in. Free buttons are in short supply, though. Is it okay to open it with the menu, or would something like a long press on the OK or MENU button be better?

Oh, only a menu option is fine for me. Talking about short-cuts, it would also be nice to implement some stylus short cuts like:
- a press somewhere on the loaded image opens the main menu of the program
- a press on the page counter (bottom left) would open the goto menu
- a press on the zoom percentage (bottom left) would open the custom zoom level input
- a press on the title (bottom middle) would open the content
Adobe Reader and FB2-reader use these short-cuts too. If you have some spare time left to implement them, it would be very nice.

Oh, only a menu option is fine for me. Talking about short-cuts, it would also be nice to implement some stylus short cuts like:
- a press somewhere on the loaded image opens the main menu of the program
- a press on the page counter (bottom left) would open the goto menu
- a press on the zoom percentage (bottom left) would open the custom zoom level input
- a press on the title (bottom middle) would open the content
Adobe Reader and FB2-reader use these short-cuts too. If you have some spare time left to implement them, it would be very nice.

I have no idea how to implement something like that, and it would be nice to see some source code. Is there source code for FB2-reader that shows how to do this? Every version I've looked at doesn't seem to implement any touch screen events.

I don't have a touch screen on my device, so I would be coding in the dark. There appear to be events like EVT_PANEL_TEXT and EVT_PANEL_PROGRESS, and I can only guess that they are for presses on those locations. I don't see any event for pressing on the title, and I don't see how to tell the difference between pressing on the page and the zoom parts of the text. I'm afraid I'd need help for coding this part. Volunteers would be welcomed.

I uploaded new copies of pbimageviewer.app as attachments to the first message in this thread. It can now pop up the dictionary. It also no longer uses the external unzip and unrar programs to unpack entire archives at startup. Instead, it unpacks one image at a time internally, so it starts and closes much faster, doesn't use much disk space anymore, and odd characters in image filenames shouldn't cause problems anymore either. Tar files are still handled the old way.

I uploaded new copies of pbimageviewer.app as attachments to the first message in this thread. It can now pop up the dictionary. It also no longer uses the external unzip and unrar programs to unpack entire archives at startup. Instead, it unpacks one image at a time internally, so it starts and closes much faster, doesn't use much disk space anymore, and odd characters in image filenames shouldn't cause problems anymore either. Tar files are still handled the old way.

Downloaded and tested it quickly. It works great. This program makes definitely the Pocketbook a better machine. Thanks again!!

Quote:

Originally Posted by rkomar

I have no idea how to implement something like that, and it would be nice to see some source code. Is there source code for FB2-reader that shows how to do this? Every version I've looked at doesn't seem to implement any touch screen events.

For opening the main menu by a background click, you could check the source of the latest poterm app at http://fedorchenko.net/pb.php. I found something called EVT_POINTERDOWN in poterm.cpp which probably should do the trick. As I have a stylus device, I could be an alfa/beta-tester for you. It would be honor because you already implemented/fixed so much things for me.

The other short-cuts I mentioned are only available in Adobe Reader and Pocketbook's fbreader and not in the open-source variant fbreader-180. In fbreader-180 you can only open the main menu by clicking somewhere in the middle of the screen, adding a bookmark by tipping in the right upper corner and zoom up/down by moving up/downwards with the stylus at right side of the screen. I checked the source at http://code.google.com/p/fbreader-pockebook/ and looked for the keyword EVT_POINTER and found in
zlibrary/ui/src/nanox/application-desktop/main.cpp and fbreader/zlibrary/ui/src/nanox/application-desktop/main.cpp.save code which calls/handles the functions above. I hope this helps some bit.

I think tapping to get the main menu should be pretty easy. I've thought for a while that dragging with the stylus would be great for panning the image. I'm not sure how to have both panning and zooming available at the same time, since the gesture would be the same. Which do you think would be more useful, or do you have an idea of how to do both?

I'll probably have a go at this tomorrow, and PM you when I have something to test. Thanks for offering to beta-test for me.

Thank you very much rkomar!! By far the best app created/ported since coolreader IMHO. For too long I have to suffer the lackluster zoom options in my Pb360+. Not only pbimageviewer have great selection of zoom options but also supports cbz/cbr files to boot!

Thank you very much rkomar!! By far the best app created/ported since coolreader IMHO. For too long I have to suffer the lackluster zoom options in my Pb360+. Not only pbimageviewer have great selection of zoom options but also supports cbz/cbr files to boot!

Thanks again for all your hard work!

You're welcome. The zooming/displaying part of the program was all done by the original code author Michail Polubisok, and it was a big reason why I decided to work with that program in the first place. I've mostly just been adding UI/cbr/cbz stuff to make it easier to use.

Updated the attachments in the first post in this thread with new versions. pbimageviewer will now show GIF and BMP images as well as JPG and PNG. There is also support for using the touchscreen (big thanks to @dtanis for helping with that).

Thanks you very much for the evolution of the application. It's really great, and fantastic to pop up the dictionnary. Almost all files opened, even with a non standart ascii name, but not all. You'll find enclosed one exception.

What about the 602 : I bought my daughter a 602 (I 'm a Pocketbook fan), but I didn't succeed to make the application working ???
I tried the 2 File Type: Pro-360+ and 3XX but cbr/cbz rar/zip aren't recognized ? Do you have any idea of what's wrong ?

Thanks you very much for the evolution of the application. It's really great, and fantastic to pop up the dictionnary. Almost all files opened, even with a non standart ascii name, but not all. You'll find enclosed one exception.

What about the 602 : I bought my daughter a 602 (I 'm a Pocketbook fan), but I didn't succeed to make the application working ???
I tried the 2 File Type: Pro-360+ and 3XX but cbr/cbz rar/zip aren't recognized ? Do you have any idea of what's wrong ?

One more time thanks a lot
Krgds Jean xxx

Hi Jean,
did you copy the app to both the /mnt/ext1/applications and /mnt/ext1/system/bin directories? It has to be in the first directory to start from the Application tab, and in the second directory to work with the cbr/cbz files.

The example file you gave contains another cbz file inside of it (rather than image files). I'm not sure I want to introduce the complication of unpacking archives from within archives (although I have seen the same thing with another set of files). It would be best if you just extracted the cbz file by hand and installed that on the device.

Edit: I just tried the cbz file and it looks like the GIF images are being rendered badly (black and white are reversed). I'll look into that.

Edit 2: I found a bug in my GIF decoder. I've updated the attachments with the fixed versions. Thanks for the example file, Jean!