2012-02-20 5 views
1

J'ai un fichier svg que je veux convertir en jpg/png. Probem est que la conversion est bien s'il n'y a pas d'image de fond. Mais quand j'essaie de mettre une image d'arrière-plan, elle n'est pas rendue dans l'image convertie et affiche une couleur de fond claire.Imagemagick svg conversion

contenu svg:

<svg height="370" version="1.1" width="350" xmlns="http://www.w3.org/2000/svg" style="overflow: hidden; position: relative; left: -0.5px;"> 
    <defs> 
     <pattern id="38A07B9C-47E8-4E02-A005-E6E4443FE5D0" x="0" y="0" patternUnits="userSpaceOnUse" height="300" width="300" patternTransform="matrix(1,0,0,1,0,0) translate(0,20)"> 
      <image x="0" y="0" href="/home/mahad/public_html/svg/user-backgrounds/4f41f6a2a75dc_back.png" width="300" height="300"/> 
     </pattern> 
    </defs> 
    <rect x="0" y="0" width="350" height="370" r="0" rx="0" ry="0" fill="#ffffff" stroke="none" style=""/> 
    <rect x="0" y="20" width="350" height="350" r="0" rx="0" ry="0" fill="url(#38A07B9C-47E8-4E02-A005-E6E4443FE5D0)" stroke="none" style="fill: url(&quot;#38A07B9C-47E8-4E02-A005-E6E4443FE5D0&quot;) rgb(0, 0, 0); opacity: 0.38;" opacity="0.38"/> 
    <rect x="0" y="20" width="14" height="14" r="0" rx="0" ry="0" fill="#000000" stroke="none" style=""/> 
    <text style="text-anchor: middle; font: 12px &quot;Arial&quot;; opacity: 1;" x="100" y="100" text-anchor="middle" font="10px &quot;Arial&quot;" stroke="none" fill="#ff0000" font-size="12px" opacity="1" transform="matrix(1,0,0,1,73,92)"> 
     <tspan dy="4.5">helllloooo...</tspan> 
    </text> 
</svg> 

commande de conversion: exec echo ("/ usr/bin/convertir /home/public_html/qr.svg /home/public_html/qr.png");

s'il vous plaît aider

Répondre

2

Dans mon cas, l'installation librsvg2-bin a résolu le problème:

sudo apt-get install librsvg2-bin

Questions connexes