![]() |
#31 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,849
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
The first way is by including the filter in body, as I do for the first image. Now, with the filter included in body, if I change the color there, then the change operates at once. Of course, this is not an economic way to include a svg filter because you need to include in every .xhtml file where you want to apply it. The second way in by including it in the css stylesheet, inside a class. In this case, I created a class named ".myCustomFilter" and I defined the filter there. But when I apply the class, the filter is not working (watch the second image). In the third image you see another svg filter, that I defined also in the css stylesheet and that filter works!! I don't know why one filter works and the other doesn't (they should work both). By in this case I think is not a bug of Sigil because I can't see the metal effect filter applied in no place (Chrome, Firefox, Thorium, etc.) when is defined in the css. |
|
![]() |
![]() |
![]() |
#32 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,849
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#33 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,911
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Why not add filter=url(./MetalFilter.svg#metal) as one of the parameters in the Image1.svg file?
|
![]() |
![]() |
![]() |
#34 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,849
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
The filter's SourceGraphic and SourceAlpha refer to the contents of the file where the filter is defined. Since the Metal_Filter.svg file only contains the filter definition and no shapes (such as a <path>), the SourceGraphic is empty. It's a "blind" filter that doesn't have a source image to operate on. Therefore, it doesn't generate any results. For it to work, the filter and the shape must be in the same SVG file. You should need something like: Spoiler:
On the other hand, with the <img> tag, the rendering engine FIRST loads Image1.svg and renders it (so, at this point, the engine already knows the shape and alpha channel of the image). Then, the css filter property tells the engine to take this already rendered image and apply the filter. The filter's SourceGraphic refers to this rendered image and now it works because the filter has a "canvas" to work on. |
|
![]() |
![]() |
![]() |
#35 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,911
Karma: 6120478
Join Date: Nov 2009
Device: many
|
This is so strange. I can not see why the .myCustomFilter class version fails and the other one works.
Your original example when unpacked from the epub will not work straight up in Safari either. So my guess this style attribute filter approach will only work with a limited number of web browsers as well as limited epub3 ebook e-readers. |
![]() |
![]() |
Advert | |
|
![]() |
#36 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,911
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Okay, by sheer trial and error, after clearing the web cache, if I use setUrl(QUrl("")); on the QWebEngineView it seems to finally force a full reload of everything.
I need to clean this up a bit and I will commit it to master tomorrow. With these changes your original demo epub will work properly with Qt 6.9.1 and later. FYI - we still have no plans to update our Windows, AppImage, and MacOS builds to Qt 6.9.1 for the next release as there are still too many outstanding bugs in Qt 6.9.1. |
![]() |
![]() |
![]() |
#37 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,849
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
Quote:
Last edited by RbnJrg; Yesterday at 11:20 PM. |
|||
![]() |
![]() |
![]() |
#38 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,849
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
![]() |
||
![]() |
![]() |
![]() |
#39 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,911
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Note, all e-readers on iOS devices must use Safari's webkit (even Chrome and Firefox browsers use the Safari Webkit) on iOS, and that includes Books as well. So none of them will support this in e-readers on iOS as far as I can tell.
Last edited by KevinH; Today at 10:15 AM. |
![]() |
![]() |
![]() |
#40 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,911
Karma: 6120478
Join Date: Nov 2009
Device: many
|
FWIW, people filed a bug report in Chrome to support external urls for filters way back in 2012 and it was not until last fall (2024) that this was fixed in a released version of chrome. It took them over 12 years to implement this.
Qt 6.8.x is based on Chrome 130 series whereas I think Qt's 6.9.x series is based on Chrome 138 series or later. So support for this feature will be really hit and miss depending on which version of chrome's blink was used for a specific e-readers firmware, or if they are running on iOS or not. So use these features at your own risk as support is not widespread. Last edited by KevinH; Today at 10:16 AM. |
![]() |
![]() |
![]() |
#41 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,911
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Okay, I have pushed the final set of changes needed to support using url's in style attribute filter properties to master.
I have also updated the base for translations since so much code was added, removed, or modified. Note: With a fresh build from master, the first testcase posted by RbnJrg in this thread should now work (without a need to switch tabs) in Qt 6.9.1 based systems. Even with this change in place. Sigil will still *not* show the style flood color in any version of Sigil based on Qt 6.8.2 or earlier, including our forthcoming release. ie. it will not work on AppImage, Windows, and MacOS versions of Sigil. When the test case files are unpacked from the epub, even the very very latest Safari browser will NOT work. So beware of using these techniques if you want your epub to work on iOS based or even older chrome based e-readers, as the fix for chrome to handle this case was not completed until last August (2024) and not very many Qt versions include it as of yet. Last edited by KevinH; Today at 11:42 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle 4 Cant reach certain buttons issue and opening keyboard issue | Thefirebeast | KOReader | 6 | 06-26-2021 12:46 AM |
issue converting from azw3 to mobi (ccs and font issue) | fatkinglet | Conversion | 3 | 10-15-2020 10:13 PM |
preview vs print preview | isalherbo | Sigil | 7 | 04-23-2013 03:52 PM |
Nook Simple Touch Glowlight - technological issue or quality-control issue? | Dr. Drib | Barnes & Noble NOOK | 1 | 12-04-2012 01:32 PM |
Hyperlinks Issue in NLT Bible (ebook or software issue)? | myet01 | Kobo Reader | 5 | 07-29-2011 08:47 AM |