|
|
#1 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,129
Karma: 7640000
Join Date: Nov 2009
Device: many
|
Head's up for those that build Sigil from source
Hi All,
The Epub 3.4 spec has introduced two new base image formats: avif and jxl. Unfortunately Qt QImage has no support for either of them. And QtWebEngine/Chrome still has no out of the box support for the jxl format. So if you look at our Sigil-Ebook repo, you will see a new repository called qtimageformats2. In this repository we collected all the different repositories into one build to create Qt image plugins for both the avif and jxl formats. These plugins have been added to our official Qt builds for Windows and MacOS and so our next release will include them. That means when Sigil-2.8.5 is officially released ImageTab AdjustImage and other tools that use QImage will now support those new avif and jxl formats for Read and Write. That still leaves the issue of no jxl image support in QtWebEngine / Chrome / Electron, and thus in our Preview, View Image, etc. To work around this until QtWebEngine reaches a Chrome build that actually supports jxl and turns it on (Chrome build 155) we are using our URLSchemeHandler to "polyfill" the jxl image by converting it on the fly behind the scenes to a PNG image (to assure no image degradation losses) for QtWebEngine. Please note the epub itself and that jxl image are unchanged! The png is just shown by Preview, nothing more. When an jxl image is asked for by QtWebEngine we deliver a png image instead so inside Preview everything works and you see the exact same thing you would have seen if jxl was supported in the QtWebEngine/Chrome. So what does this mean for you ... - the next release of Sigil will allow support for avif and jxl images as required by the Epub 3.4 spec. From a building your own Sigil standpoint, you will need to use one of our recent Qt builds that has the new image format plugins installed, or if you build your own Qt, you will need to git clone: https://github.com/Sigil-Ebook/qtimageformats2.git Then try your own build of the plugins and then hand install them in your Qt builds *before* building Sigil. Both DiapDealer and I would be happy to help you get initial builds of qtimageformats2 going to build the qavif and qjpegxl6 Qt image plugins if you decide to go that route. Just post in this thread any questions or issues you run into. For those of you that use my latest Qt6.10.2 builds on MacOS (downloaded from my personal BuildSigilOnMac release page) for your builds of Sigil, the plugins are already installed in that build and all should just work. For those of you using DiapDealer's Windows Qt builds for your builds, just download the latest version in a few days (some kinks are still being worked out) and you should be good to go. As for Linux builders: On recent Linux KDE distributions both jxl and avif qt plugins already exist and everything should just work. On other Linux distributions you should be able to build our qtimageformats2 repo out of the box with few issues. Just post in this thread any questions or issues you run into. Thanks! Last edited by KevinH; 10-08-2026 at 01:32 PM. |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,816
Karma: 212614993
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm pretty sure I have the Windows kinks worked out. For those who use my custom-built Qt6.10.2 for building Sigil on Windows, you'll need to download it again to get the support for avif and jxl.
https://github.com/dougmassay/win-qt...s/tag/v5.212-1 I changed the name slightly (so I don't get confused about what is what). On that release page, the archive you want is named Qt6.10.2ci_x64_VS2026a.7z Yes... I just added an 'a' to it. ![]() Pull the latest changes from Sigil's github repo to make sure your Sigil builds will incorporate the new plugins. I'm working on getting the Linux AppImage up to speed as we speak. Last edited by DiapDealer; 10-08-2026 at 04:09 PM. |
|
|
|
|
|
#3 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,069
Karma: 3999999
Join Date: Jan 2017
Location: Poland
Device: Various
|
I built it without any problems on Windows, and I can confirm that the AVIF and JXL images work.
|
|
|
|
|
|
#4 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,816
Karma: 212614993
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Great! Thanks for reporting back. I've got the Linux AppImage build updated and working as well.
|
|
|
|
|
|
#5 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 55,001
Karma: 182340534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
My build under Windows 11 allows me to insert JXL/AVIF images and they seem to display correctly if a bit slowly. OTOH, the Delete Unused Media Files tool will happily mark those files for deletion.
My latest test build for Windows can be downloaded from the link in the Downloading Sigil test builds for Windows thread. My test ePub is attached to this message. |
|
|
|
|
|
#6 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,129
Karma: 7640000
Join Date: Nov 2009
Device: many
|
I will check into why Delete Unused media is ignoring the proper usage of jxl and avif media. It should be treating them just like any other image resource. The mime type should not matter only the fact that resource is used in a url or img src.
So strange. As for Preview, yes loading a jxl should be slower as it has to load the jxl, decode it, then convert it to a png on the fly. But when I open an ImageTab, it should appear quite quickly as it as no conversion is needed. For avif, it has native support in QtWebEngine and so showing it in Preview should be quick as should ImageTab. No polyfill is needed. Last edited by KevinH; Yesterday at 08:54 AM. |
|
|
|
|
|
#7 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,816
Karma: 212614993
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm not seeing the Delete Unused Media Files issue on Windows. I have an avif and a jxl inserted into an epub's xhtml and they do not show up as unused when I run the tool. Nor am I seeing any noticeable lag in loading (granted, my jxl is quite small).
When I delete the image tags from the xhtml, the Delete Unused Media Files tool shows them as unused. When I paste the image tag code back in, they don not show up as unused. We may want to see what @Becky reports on this. |
|
|
|
|
|
#8 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,816
Karma: 212614993
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Wait a minute @DNSB's test epub has all of the avif, jxl files in svg wrappers. They definitely show up as unused under that circumstance. I also see the lag in loading (in Preview) as his images are several Mb larger than mine.
The lag is pretty painful on my tired old laptop. Especially when trying to flip through image resource tabs when there's an xhml resource with a jxl image open in Preview. With no xhtml tab open that uses a jxl image (or with Preview closed), there is no lag in switching between the various image resource tabs. Last edited by DiapDealer; Yesterday at 10:33 AM. |
|
|
|
|
|
#9 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,129
Karma: 7640000
Join Date: Nov 2009
Device: many
|
It works just fine for me. But I did not test with svg.
Does his svg include the xlink:href or not? Just put a jxl in the cover image and tested it. It is properly detected as being used. Not sure about what is going on. Will try his testcase. Last edited by KevinH; Yesterday at 10:48 AM. |
|
|
|
|
|
#10 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,129
Karma: 7640000
Join Date: Nov 2009
Device: many
|
Okay. He used the latest version of Add Cover with that svg and it uses xlink:href and href attributes on the same image tag.
Just remove the href attribute leaving the xlink:href attribute and all problems go away (except for the slow speed). So there is code in Sigil that looks specifically for xlink:href in svg to find image links that actually rules out just a normal href since that never used to be legal. To make matters worse (it does not think any image tag or img will have more than one href or xlink:href attribute. I will have to change that search to loop through all attributes on an image tag to check href and xlink:href (and what if they point in different places!). So I now understand the bug and will search for all attributes on an image tag and accept any href not just the xlink:href attribute. Nice catch. Takes both to trigger the bug. |
|
|
|
|
|
#11 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,129
Karma: 7640000
Join Date: Nov 2009
Device: many
|
And for what it is worth, these are large image files 2 Meg and 5 Meg (compressed) even though jxl and avif have higher compression so these are big images for any epub. Then imagine the size once that uncompressed jxl image converted to a png. Perhaps converting to a lossy jpeg might be faster for Preview.
Last edited by KevinH; Yesterday at 11:04 AM. |
|
|
|
|
|
#12 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,069
Karma: 3999999
Join Date: Jan 2017
Location: Poland
Device: Various
|
I was just testing with an img.
But now I've added an svg, and I don't see the problem with "Delete Unused Media Files." EDIT: OK, I wiil test it too. EDIT2: I see that. Last edited by BeckyEbook; Yesterday at 11:15 AM. |
|
|
|
|
|
#13 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,129
Karma: 7640000
Join Date: Nov 2009
Device: many
|
Okay, I will push a fix for this that will accept either an xlink:href or a href on an svg image tag but whichever is found first in the image tag will determine the linked image. If you change one to point to a different image, all promises are off.
Next I will change the polyfill to be a jpeg saved at 95% quality instead of a png to see if that speeds the jxl polyfill up. Last edited by KevinH; Yesterday at 11:25 AM. |
|
|
|
|
|
#14 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,129
Karma: 7640000
Join Date: Nov 2009
Device: many
|
Okay, I pushed a fix for better handling of images in svg image tags with just href, and tried to speed up loading of jxl polyfills by converting to jpeg at 95% instead of too png.
It seemed to speed things up. Interestingly, the avif images in DNSB's test case which do not use polyfill seem to be loading slower than the jxl images inside Preview. If you have a free moment, please test out these fixes and let me know. Thanks |
|
|
|
|
|
#15 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,816
Karma: 212614993
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
It checks out fine on the Linux AppImage. I'm running a Windows CI build right now. I'll check it out after lunch.
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Head's up for those who build their own. | KevinH | Sigil | 13 | 08-07-2026 09:32 AM |
| [help] How can I build the Kindle firmware source code? | BlueFalconHD | Kindle Developer's Corner | 2 | 01-02-2023 05:59 PM |
| Sigil output with no html or head elements | pittendrigh | Sigil | 10 | 08-25-2018 08:58 AM |
| Sigil messing up Head | tetrault | Sigil | 8 | 08-05-2016 12:10 AM |
| pristine build from git HEAD is broken | eschwartz | Calibre | 2 | 05-03-2016 01:34 AM |