readium-shared-js icon indicating copy to clipboard operation
readium-shared-js copied to clipboard

Pages are incorrectly scaled when SVG height and width are specified - SDK

Open rkwright opened this issue 8 years ago • 2 comments

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

  1. Open the test file
  2. Navigate to the last page
  3. Observe that the rendered page is huge, like this:

osx_scaling

when it should look like this: (Vital Source Reader)

vs_correct

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.

rkwright avatar Aug 22 '16 14:08 rkwright

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 avatar Sep 13 '16 16:09 olivierkorner

@olivierkorner Thanks for looking into this.

rkwright avatar Sep 13 '16 16:09 rkwright