Bug 697749 - CBZ and EPUB with .WEBP images are not supported
Summary: CBZ and EPUB with .WEBP images are not supported
Status: UNCONFIRMED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: epub (show other bugs)
Version: master
Hardware: PC Linux
: P4 enhancement
Assignee: MuPDF bugs
URL:
Keywords:
: 704783 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-04-13 05:33 UTC by foobnix
Modified: 2024-10-12 08:53 UTC (History)
5 users (show)

See Also:
Customer:
Word Size: ---


Attachments
ExampleCBZ+WEBP.cbz (331.90 KB, application/x-cbz)
2017-04-13 05:33 UTC, foobnix
Details
Webp support using libwebp (81.97 KB, patch)
2022-05-05 14:26 UTC, Vijay Mohan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description foobnix 2017-04-13 05:33:35 UTC
Created attachment 13568 [details]
ExampleCBZ+WEBP.cbz

Please add support for modern image format .webp
Comment 1 Tor Andersson 2018-11-13 23:16:39 UTC
WebP is not common enough to warrant adding yet another third party library dependency and code size.
Comment 2 foobnix 2021-12-20 10:50:52 UTC
Maybe it's time to add WEBP support, 2022 is comming and WEBP has become very popular in EPUB books as well.
Comment 3 Tor Andersson 2021-12-25 12:42:42 UTC
*** Bug 704783 has been marked as a duplicate of this bug. ***
Comment 4 Vijay Mohan 2022-05-05 14:26:52 UTC
Created attachment 22498 [details]
Webp support using libwebp

This patch adds support for webp using libwebp. There is support for ICCP and EXIF as well. Just as for some other third party libraries, both static and system libs are supported for *nix platforms.
Compilation has been verified for Windows, Linux, Wasm, Python, Android and Java. Unable to verify for Mac as I do not have one.

Patch contains thirdparty submodule for libwebp.

Have submitted Artifex Contributor License Agreement to info@artifex.com
Comment 5 Hin-Tak Leung 2024-08-20 21:35:39 UTC
Okay, I was going to file a new bug about this and got here.
Comment 6 Hin-Tak Leung 2024-08-24 20:33:00 UTC
I tried the attached patch - there are some bitrot against current head (mainly collisions with psd - photoshop? - image support which was added later), and I found it couldn't open the attached sample file. (which calibre can open).

Anyway, I see the code added is mainly in the cbz code path, and I am wondering about its applicability to the epub code path, which is where I came from.

I have a bunch of epub's - which are zipped html's - for which mupdf current emits these:

...
format error: cannot locate font '../Fonts/nzkxzd.ttf' specified by css
warning: cannot load font-face: ../Fonts/nzkxzd.ttf
warning: html: cannot load image src='../Images/head-05.webp'
warning: html: cannot load image src='../Images/end.webp'

i.e. the webp images are referenced by the html's.
Comment 7 Hin-Tak Leung 2024-08-24 20:34:32 UTC
FWIW, webp images are quite common these days - news.yahoo.com uses them, for example.
Comment 8 Hin-Tak Leung 2024-08-24 20:34:45 UTC
FWIW, webp images are quite common these days - news.yahoo.com uses them, for example.
Comment 9 Hin-Tak Leung 2024-08-26 01:10:55 UTC
The patch (after correct for bitrot) does support those epubs I have.

Sorry about the noise - scripted the rpm rebuild and didn't get the patch applied correctly.
Comment 10 Vijay Mohan 2024-08-26 01:50:33 UTC
If you have updates to the patch, do share. The maintainers of MuPDF have no intention of adding this support. I wanted to contribute to this project. I offered to help with development and testing but that went nowhere :)

I am happy at least my patch was useful for LibreraReader project.
Comment 11 Frans de Jonge 2024-10-12 08:53:55 UTC
> If you have updates to the patch, do share.

We use an updated version of the patch here: https://github.com/koreader/koreader-base/blob/a3cf1e93efd182292827d5ee3028c9128f33131c/thirdparty/mupdf/webp-upstream-697749.patch