unwanted changes of svg code during conversion

Bug #2058798 reported by quinta@ebf.cz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

There are noticed odd changes in inline svg code during conversion. Especially during conversion epub>epub (because in that case svg input and output codes can be compared), but the same impacts can be seen in rendered raster images in case of conversion to other formats.

example of input inline svg:

<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100%" height="100%" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 15849.6 21132.8"
 xmlns:xlink="http://www.w3.org/1999/xlink"
>
 <defs>
  <style type="text/css">
   <![CDATA[
    .fil0 {fill:#2B2A29}
    .fnt1 {font-weight:bold;font-size:493.89px;font-family:'MIRobokat'}
    .fnt0 {font-weight:normal;font-size:635px;font-family:'MIRobokat'}
   ]]>
  </style>
 </defs>
 <g id="Vrstva_x0020_1">

  <text x="5218.93" y="6709.26" class="fil0 fnt0">KAREL ČAPEK</text>
  <text x="5265.25" y="7298.9" class="fil0 fnt1">VÁLKA S MLOKY</text>
 </g>
</svg>

corresponding output:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" width="100%" height="100%" version="1.1" viewBox="0 0 15849.6 21132.8" class="calibre2">
 <defs>
  <style type="text/css" class="calibre3">

    .fil0 {fill:#2B2A29}
    .fnt1 {font-weight:bold;font-size:493.89px;font-family:'MIRobokat'}
    .fnt0 {font-weight:normal;font-size:635px;font-family:'MIRobokat'}

  </style>
 </defs>
 <g id="Vrstva_x0020_1">

  <text x="5218.93" y="6709.26">KAREL ČAPEK</text>
  <text x="5265.25" y="7298.9">VÁLKA S MLOKY</text>
 </g>
</svg>

Especially removing style references is quite destructive for this particular example. Since I'm not very familiar with svg, I can't decide if the changes could be intentional for some reason... But all in all, they all appear to be a bug.

Calibre 7.7 (but conversion behaviour seems to be years old)
Windows 10

https://www.mobileread.com/forums/showthread.php?p=4408203

Revision history for this message
quinta@ebf.cz (quinta-ebf-cz) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote :

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

Changed in calibre:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.