webp support

thingfromspace 6 years ago updated by Tom 6 years ago 10
Webp doesn't seem to be a supported image filetype in CBx archives. Thumbnails aren't being generated and issues can't be read streamed through the web.

ComicRack included support for reading and converting to webp images a while back. Webp offers excellent lossy compression while maintaining relative image quality for comic pages. I do understand webp is not nearly as widely supported as jpg, but almost all android tablets and phones (as well as chrome) support it.

Unfortunately, while almost all of my issues have been saved to webp in cbz, Ubooquity is only working with the handful of issues I still have in jpg/cbz.
Thing, Ubooquity probably has an array of files to look for when building the <img> tab that displays the thumbs and pages. That array includes filename extensions like jpg, jpeg, gif, png and other common image formats. I just did a text search through the Ubooquity jar and did not find webp. The author, Tom, will need to simply add "webp" to that array of filename extensions to display.

However, just because Ubooquity builds an image tag that points to a webp image does not mean that you will be able to view the thumbnail or page.

Different browsers have different support for this new image type. Open up this link in a new tab. If you are using FireFox on Windows you won't be able to see the webp image in the bottom right. If you open that link with Chrome you will be able to see the webp image.

It's up to the browser manufacturers to determine what file types to natively support. If you use FireFox to browse your Ubooquity collection post a feature request on the Mozilla forums for them to adopt webp.
Thanks for the reply! I hope it would be as simple as adding a new text string to the code to allow indexing webp pages. However, I'd think the application would need a webp decoder to read and convert the cover for the issue thumbnail. I'm willing to keep a blank cover thumbnail if I can stream my webp books (that is the coolest!)

As for browser support, you make a valid point. It's unfortunate not all browsers support the format. I personally understand what's required for webp since I've invested the time converting the books I have to that format but I can see how the author could possibly pass on adding this feature because of the possible support issues.
Once Tom gets back there is a good possibility he'll add decoding because he agreed to add support to the obscure DJVU document format and there are a couple good webp decoders for JAVA including webp-imageio available to him.

I hadn't thought about the fact that the server software would have to decode then re-encode the images for thumbnails. I had assumed the server simply constrained the first page width using CSS or the HTML "width" attribute, but that would make the server send over the entire first page and have the browser squish it, increasing bandwidth requirements by a lot!
Under review
Here are a few clarifications on the matter.

All images Ubooquity provides, be they thumbnails or full pages, are jpeg generated by Ubooquity itself. So there won't be any browser compatibility problem (at not point does Ubooquity just "forward" the images, they are all read and resized).

Webp support requires a decoder. "webp-imageio" is not a candidate as it is only a wrapper around native code. Using it would require different version of Ubooquity depending on the platform you run it on (Linux, Windows, Mac OS...). Not an option.

I have howver found a free, full java Webp decoder. I will test it and add Webp support if it works well enough. That is if I find the time to do it. As you might have noticed, Ubooquity development has been even slower than before and I won't have much time to give it to in the coming months.
Tom, thank you for the clarification. I hope you find a nice balance with development and real life!
I wanted to let you know the webp support you've implemented works flawlessly so far. The only drawback to this is the time to load new pages when reading comics online. Comics with pages already in jpg format load as fast as I can turn the pages. Webp pages take 3-5 seconds to load. I'm sure this is the conversion from webp to jpg Ubooquity is making. I'm not complaining, just making note. I'm happy this works!

Next I'll test the Challenger Comics Viewer OPDS.

I'll be donating here shortly.
Thanks !
On which kind of device are you running your server ? (hardware and OS)