readium/readium-sdk

SVG rendering on Android app based on Readium SDK

garconvacher opened this issue · 4 comments

Hi,
There's an issue with SVG files on Android.

  • SVG aren't rendered in this case:
<img src="my.svg" />
  • SVG are rendered in these cases:
<object data="my.svg" type="image/svg+xml"></object>
<svg>(my.svg code)</svg>

cc @JayPanoz

(edit: I've maid a mistake in my epub)

So I can confirm the issue will apply to background-image as well when it’s SVG (JPG, GIF, etc. are OK), on every Android app I know is using the SDK I could test.

I’ll try to provide a sample ASAP.

Screenshot in Lea Reader

screenshot_20180316-150539

So here you go, test file for the background-image case: https://www.dropbox.com/s/t1bkxptt4ptwk59/svg-sample.epub?dl=0

@garconvacher Please feel free to re-use this file and add your use case.

In the following screenshots, when you’re seeing whitespace, there should be a dinkus a.k.a. * * * displayed (SVG background image).

Here is a control capture:

capture d ecran 2018-03-16 a 15 48 37

So, from quick testing, apps using the SDK consistently fail at rendering the SVG on Android…

screenshot_2018-03-16-15-26-20

screenshot_2018-03-16-15-27-30

screenshot_2018-03-16-15-28-41

screenshot_2018-03-16-15-29-18

On iOS, it may or may not work depending on the app so I’m correcting my previous statement…

WKWebView seems to be fine…

photo 16-03-2018 15 34 32

UIWebView is not…

photo 16-03-2018 15 37 53

Which brings the question: could that be a WebView issue?

In this case, I’m afraid that will impact Readium2 as well…