linuxmint / xviewer

A generic Image viewer
GNU General Public License v2.0
75 stars 37 forks source link

Xviewer scales Inkscape SVG as bitmap, distortion and pixelation #144

Closed BigIronLinux closed 3 years ago

BigIronLinux commented 3 years ago
 * Xviewer version 2.8.3
 * Distribution - Linux Mint 20.1

Issue

When I open an Inkscape SVG file in Xviewer 2.8.3 and enlarge or zoom in the image scales as if it were a bitmap, showing pixelation and aliasing. The issue does not occur when Inkscape SVG files are opened with other programs such as Pix, Firefox, or Chromium. Xviewer renders the image correctly if it is exported as a plain SVG.

Steps to reproduce

Create an SVG file with Inkscape, open with Xviewer 2.8.3, enlarge or zoom in, observe pixelation and aliasing.

Expected behavior

I expect Xviewer to display the SVG as a smooth vector image without pixelation, distortion, or aliasing when enlarged.

Other information

I think this may be a regression, since this issue is not present when opening the same files with Xviewer 2.4.3 on a Linux Mint 19 installation. I created a simple SVG file I used as a test, and I have attached a screenshot of how the image is displayed by Xviewer when enlarged.

svg-test-screenshot

I am not able to attach the example SVG file, so here is the source of the SVG:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="187.56873mm"
   height="77.867424mm"
   viewBox="0 0 187.56873 77.867424"
   version="1.1"
   id="svg1355"
   inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
   sodipodi:docname="svg-test-small.svg">
  <defs
     id="defs1349" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="0.54"
     inkscape:cx="-141.46962"
     inkscape:cy="128.1093"
     inkscape:document-units="mm"
     inkscape:current-layer="layer1"
     showgrid="false"
     fit-margin-top="0"
     fit-margin-left="0"
     fit-margin-right="0"
     fit-margin-bottom="0"
     inkscape:window-width="1920"
     inkscape:window-height="1018"
     inkscape:window-x="0"
     inkscape:window-y="0"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata1352">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="translate(-12.624067,-86.718633)">
    <g
       aria-label="SVG"
       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
       id="text1359"
       transform="matrix(1.0402898,0,0,1.0402898,4.6014802,-18.044383)">
      <path
         d="m 90.900208,141.07363 q 1.608667,0 1.608667,-1.10067 0,-0.33866 -0.148167,-0.5715 -0.137583,-0.24341 -0.381,-0.41275 -0.243416,-0.17991 -0.560916,-0.30691 -0.306917,-0.127 -0.656167,-0.254 -0.402167,-0.13759 -0.762,-0.30692 -0.359833,-0.17992 -0.624417,-0.41275 -0.264583,-0.24342 -0.423333,-0.5715 -0.148166,-0.32808 -0.148166,-0.79375 0,-0.96308 0.656166,-1.50283 0.656167,-0.53975 1.80975,-0.53975 0.66675,0 1.2065,0.14816 0.550333,0.13759 0.804333,0.30692 l -0.328083,0.83608 q -0.22225,-0.13758 -0.66675,-0.26458 -0.433917,-0.13758 -1.016,-0.13758 -0.296333,0 -0.550333,0.0635 -0.254,0.0635 -0.4445,0.1905 -0.1905,0.127 -0.306917,0.32808 -0.105833,0.1905 -0.105833,0.45508 0,0.29634 0.116416,0.49742 0.116417,0.20108 0.328084,0.35983 0.211666,0.14817 0.486833,0.27517 0.28575,0.127 0.624417,0.254 0.47625,0.1905 0.867833,0.381 0.402167,0.1905 0.687917,0.45508 0.296333,0.26459 0.455083,0.635 0.15875,0.35984 0.15875,0.87842 0,0.96308 -0.709083,1.48167 -0.6985,0.51858 -1.979084,0.51858 -0.433916,0 -0.804333,-0.0635 -0.359833,-0.0529 -0.645583,-0.127 -0.28575,-0.0847 -0.497417,-0.16933 -0.201083,-0.0952 -0.3175,-0.15875 l 0.306917,-0.84667 q 0.243416,0.13758 0.740833,0.30692 0.497417,0.16933 1.217083,0.16933 z"
         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;stroke-width:0.26458332"
         id="path1361"
         inkscape:connector-curvature="0" />
      <path
         d="m 100.75329,134.46963 q -0.40217,1.16417 -0.772586,2.159 -0.359834,0.98425 -0.709084,1.87325 -0.34925,0.889 -0.6985,1.70392 -0.338666,0.80433 -0.6985,1.59808 h -0.963083 q -0.359833,-0.79375 -0.709083,-1.59808 -0.338667,-0.81492 -0.6985,-1.70392 -0.34925,-0.889 -0.719667,-1.87325 -0.370417,-0.99483 -0.762,-2.159 h 1.132417 q 0.5715,1.67217 1.121833,3.21733 0.550333,1.54517 1.132417,2.89984 0.582083,-1.34409 1.132416,-2.88925 0.550334,-1.55575 1.11125,-3.22792 z"
         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;stroke-width:0.26458332"
         id="path1363"
         inkscape:connector-curvature="0" />
      <path
         d="m 106.0661,138.19496 h 1.02658 v 3.429 q -0.127,0.0423 -0.37041,0.0952 -0.23284,0.0529 -0.55034,0.10584 -0.30691,0.0529 -0.67733,0.0847 -0.37042,0.0423 -0.75142,0.0423 -0.77258,0 -1.40758,-0.254 -0.635,-0.254 -1.09008,-0.74084 -0.45509,-0.48683 -0.70909,-1.19591 -0.24341,-0.70909 -0.24341,-1.62984 0,-0.92075 0.27516,-1.62983 0.28575,-0.71967 0.762,-1.2065 0.47625,-0.48683 1.11125,-0.74083 0.64559,-0.254 1.37584,-0.254 0.49741,0 0.87841,0.0635 0.39159,0.0635 0.66675,0.14816 0.27517,0.0847 0.4445,0.16934 0.17992,0.0847 0.24342,0.127 l -0.32808,0.85725 q -0.30692,-0.20109 -0.81492,-0.32809 -0.508,-0.13758 -1.03717,-0.13758 -0.56091,0 -1.02658,0.20108 -0.45508,0.20109 -0.78317,0.58209 -0.3175,0.381 -0.49741,0.93133 -0.17992,0.53975 -0.17992,1.21708 0,0.65617 0.14817,1.19592 0.15875,0.53975 0.46566,0.93133 0.3175,0.381 0.77259,0.59267 0.46566,0.21167 1.09008,0.21167 0.4445,0 0.75142,-0.0423 0.3175,-0.0529 0.45508,-0.0953 z"
         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;stroke-width:0.26458332"
         id="path1365"
         inkscape:connector-curvature="0" />
    </g>
  </g>
</svg>

Thank you very much for your help.

programmer-ceds commented 3 years ago

I've just downloaded your file and tried with xviewer V3.0.2 (Mint 20.2, Cinnamon) - the following is the bottom of the S zoomed in as far as xviewer will allow: With_V3_0_2

Edit 11.7.2021 - Out of interest I just temporarily changed MAX_ZOOM_FACTOR from 20 to 60 - as expected the image can be zoomed three times bigger than normal. It still shows no 'jaggies'

BigIronLinux commented 3 years ago

Thanks for looking into this. I see that Linux Mint 20.2 is available now, so I will upgrade as soon as I can and report back. Thanks again.

BigIronLinux commented 3 years ago

Sorry for the delay, but I upgraded to Linux Mint 20.2 and this issue is no longer present with Xviewer 3.0.2. Thanks again for investigating @programmer-ceds, and thanks for the great work on this project!