Comment 3 for bug 1527642

Revision history for this message
su_v (suv-lp) wrote :

> that uses a shape to clip a bitmap

This description does not really match what is inside the minimal test case - the clip is actually a nested group structure with yet another clip applied to a group inside the top-level group in the clipPath definition:

 <clipPath
       clipPathUnits="userSpaceOnUse"
       id="clipPath66">
      <path
         d="m 64.71,45.36 398.664,0 0,373.68 -398.664,0 0,-373.68 z"
         id="path68"
         inkscape:connector-curvature="0" />
    </clipPath>

    <clipPath
       clipPathUnits="userSpaceOnUse"
       id="clipPath4927">
      <g
         id="g4929"
         transform="matrix(1.25,0,0,-1.25,72.169206,667.14622)">
        <g
           id="g4931"
           clip-path="url(#clipPath66)">
          <path
             d="m 129.77548,230.95403 5.35348,42.37718 0,0 3.0712,-0.39658 3.06895,-0.4135 3.06664,-0.43042 3.06421,-0.4473 3.0617,-0.46419 3.0591,-0.48106 3.0564,-0.49791 3.05361,-0.51475 3.05073,-0.53157 3.04775,-0.54838 3.04468,-0.56516 3.04152,-0.58194 3.03826,-0.59869 3.03492,-0.61543 3.03149,-0.63215 3.02795,-0.64885 3.02433,-0.66552 3.02061,-0.68219 3.01681,-0.69882 0,0 -9.75378,-41.58545 0,0 -2.78746,0.6457 -2.79098,0.63032 -2.79441,0.61493 -2.79775,0.59952 -2.80102,0.58409 -2.8042,0.56864 -2.80729,0.55318 -2.81029,0.5377 -2.81321,0.5222 -2.81605,0.50668 -2.8188,0.49116 -2.82146,0.47562 -2.82405,0.46006 -2.82653,0.44448 -2.82894,0.4289 -2.83127,0.4133 -2.83349,0.39769 -2.83565,0.38207 -2.83771,0.36644"
             style="fill:none;stroke:#0000ff;stroke-width:1;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
             id="path4933"
             inkscape:connector-curvature="0" />
        </g>
      </g>
    </clipPath>

The SVG file as is does not render any visible content in other SVG viewers because the outer clipPath is invalid - there are no groups allowed in clipPath definitions. This is already tracked in bug #1019159 and bug #1441152 (Inkscape may produce invalid clipPath definitions).

During PDF export, the two nested clipPath applications seem to get pulled out of the nested group structure and effectively applied as combined to one, which - based on the geometry of the two clipPaths - does produce the effect of 'cutting' a hole out of the bitmap (see attached SVG file). I'm not sure whether this should be considered a bug in Inkscape's PDF export, since the clipPath as-is is not valid SVG to begin with.