readium-shared-js
readium-shared-js copied to clipboard
Pages are incorrectly scaled when SVG height and width are specified - SDK
This issue is a Bug
Related issue(s) and/or pull request(s)
See also #327
Expected Behaviour
Should render the last page of the sample file 5 cm wide and 10 cm hight
Observed behaviour
Instead, Readium scales the page so it is (apparently) 10x the size of the container.
Steps to reproduce
- Open the test file
- Navigate to the last page
- Observe that the rendered page is huge, like this:
when it should look like this: (Vital Source Reader)
Test file(s)
https://drive.google.com/open?id=0BzaNaBNAB6FjUG1ydF9RWllCM0U
Product
SDKLauncher-OSX, 0.24-alpha on OSX 10.11
Additional information
ReadiumJS scales it wrong as well, but differently. See #327 . Note it is scaled in the same wrong way on SDKLauncher-iOS as well.
If the size of SVG is not defined in percent, it is interpreted by Readium as being in pixels, even if another unit is specified (like 'cm' in the test file). A way to convert units from 'cm' or 'in' to pixels is needed to properly handle this case.
@olivierkorner Thanks for looking into this.