New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iBooks doesn't display SVG with bitmap art #38
Comments
@bcholfin just updated your post—some html content was getting lost in the markdown convertor. |
Thanks--I forgot about that. |
Can we just call SVG and iBooks an unhappy couple? When I tested multiple SVG images in one EPUB in iBooks 3.2/iOS 7.X on an iPad 2, the whole file crashed, then iBooks crashed. I got an iPad Air, and the SVG displayed, but page turns were kludgy. I'm not really comfortable releasing a file with more than 1-2 SVG images to iBooks because it affects performance. |
It is a bit more complicated than that. There are a zillion different ways to insert an SVG in an XHTML document, and browsers and ereaders’ support for externally referenced resources is different depending on the insertion method, most of them failing at some point on chained references (i.e. referencing an SVG document that references external resources itself).
Here you have a table with my tests. I can provide the markup used to carry out these tests or even the EPUB itself (via a pull request?). HTML with SVG with external PNG image
This table does not reflect the level of SVG supported (fonts, textPath…), which most probably also varies depending on the SVG insertion method, nor whether other types of externally referenced resources besides an external PNG image (by using the This table does not reflect either where PNG transparency is supported. It is supported in all cases where the PNG displays, except for Kindle and Google Play web, where support depends on the insertion method of the SVG, and ADE 1.7 where it is not supported at all. Footnotes
|
Take a look at epubtest.org. Go to compare. You can download the test suite. Let me or someone from BISG, IDPF, or DAISY know if you think there are improvements/changes to be made to the files. This suite of files tests elements of the EPUB spec (SVG http://www.idpf.org/epub/301/spec/epub-contentdocs.html#sec-svg). In the future, there is talk of adding tests that document what happens when you go beyond spec. |
I did look at epubtest.org, but the tests there for SVG are totally insufficient, as most tests do not consider different SVG insertion methods and neither they mentioned which one was used in their grid (although one can indeed make the effort to just look at their code at https://github.com/IDPF/epub-testsuite). Take into account my table only tests whether a PNG referenced from SVG inside an XHTML document gets displayed. That would be a single row in epubtest.org's tests, and in my table that takes 12. Now think about the same regarding SVG fonts, SVG in XHTML referencing other external SVG resources ( I was thinking about cloning their repo and extending their SVG tests with mine, but it would require quite a major shake up in how they have SVG tests organized, so it is not something I am desperately looking forward to do. |
But it would be VERY worth the effort for the entire community. In the On Mon, Aug 25, 2014 at 10:47 AM, elmimmo notifications@github.com wrote:
|
I will consider it. Getting familiar with how tests in epubtest.org are organized, what I feel are some things in my reach that are not being tested, and then maybe actually doing it myself is no small deal. It is therefore not something that, at any rate, I will be doing in the next few days. |
If an SVG file contains any PNG or jpg data, that data won't display in iBooks. The workaround is to use
<embed>
instead of<img>
to point to the SVG; then iBooks will read the embedded bitmap data. Other readers I've checked (Kindle, ADE, Firefox) seem to be okay with<embed>
, so no separate version required.The text was updated successfully, but these errors were encountered: