View Single Post
Old 09-10-2019, 09:30 AM   #59
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,255
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
re: the Viewer

I've noticed quite a big difference between the old and new Viewer in how full page images are displayed when they are coded using <svg> tags like, or very similar to, a calibre cover.

The attached image shows what I mean. I opened the same epub 4 times in a similar size window. All 4 used Flow mode, but changing to Paged mode in the new Viewer didn't appear to change the visuals for these 2 images..

The 2 on the left are the old Viewer and the 2 on the right the new Viewer.

The top row shows the cover page - a typical calibre svg-style cover with preserveAspectRatio="none"
Spoiler:
Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
  <meta name="calibre:cover" content="true"/>
  <title>Cover</title>
  <style type="text/css" title="override_css">
  @page {
      padding: 0;
      margin: 0;
  }
  body {
      text-align: center;
      padding: 0;
      margin: 0;
  }
  </style>
</head>

<body>

  <div>

    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 1374 2100" preserveAspectRatio="none">
      <image width="1374" height="2100" xlink:href="../images/cover.jpeg"/>
    </svg>

  </div>

</body>

</html>


The bottom row shows what is supposed to be a full page map with similar svg-style code with preserveAspectRatio="xMidYMid meet" and no inline CSS in <head>.
Spoiler:
Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title>The Lions of Al-Rassan</title>
  <link href="../template.css" rel="stylesheet" type="text/css"/>
</head>

<body>

  <div id="map01">

    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 580 1015" preserveAspectRatio="xMidYMid meet">
      <image width="580" height="1015" xlink:href="../images/map.jpg"/>
    </svg>

  </div>

</body>

</html>


The old Viewer seems to give a more predictable visual result. Is this "just the way QWebEngine rendering is" or is it possible to make old and new more similar?

ETA: Oops! Didn't see thiago.eec's post before posting this.
Attached Thumbnails
Click image for larger version

Name:	calviewer.jpg
Views:	173
Size:	263.4 KB
ID:	173370  

Last edited by jackie_w; 09-10-2019 at 09:41 AM. Reason: ETA
jackie_w is offline