<?php
header("Content-type: image/svg+xml");
echo '<?xml version="1.0" encoding="iso-8859-1"?>';

$taille_svg 	= 45; // c'est forcément carré
$taille 	= $_GET['taille'];
$scale 		= $taille / $taille_svg; 
	
// suffit de transformer les largeurs et hauteurs fixes et d'ajouter vers la balise g : transform="scale({$scale}, {$scale})"
// et remplacer les 45 par {$taille}
		
$SVG = <<<EOF
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://web.resource.org/cc/"
   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="{$taille}"
   height="{$taille}"
   id="svg3128"
   sodipodi:version="0.32"
   inkscape:version="0.44.1"
   version="1.0"
   sodipodi:docbase="/home/cburnett/wikipedia/images/chess"
   sodipodi:docname="Chess pll45.svg">
  <defs
     id="defs3130" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     gridtolerance="10000"
     guidetolerance="10"
     objecttolerance="10"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="11.2"
     inkscape:cx="22.89394"
     inkscape:cy="17.72157"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     height="{$taille}px"
     width="{$taille}px"
     inkscape:grid-points="true"
     showgrid="true"
     inkscape:window-width="977"
     inkscape:window-height="965"
     inkscape:window-x="0"
     inkscape:window-y="31"
     gridspacingx="0.5px"
     gridspacingy="0.5px" />
  <metadata
     id="metadata3133">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />

      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="scale({$scale}, {$scale})">
   <path
       style="opacity:1;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:black;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:1"
       d="M 22 9 C 19.792 9 18 10.792 18 13 C 18 13.885103 18.29397 14.712226 18.78125 15.375 C 16.829274 16.496917 15.5 18.588492 15.5 21 C 15.5 23.033947 16.442042 24.839082 17.90625 26.03125 C 14.907101 27.08912 10.5 31.578049 10.5 39.5 L 33.5 39.5 C 33.5 31.578049 29.092899 27.08912 26.09375 26.03125 C 27.557958 24.839082 28.5 23.033948 28.5 21 C 28.5 18.588492 27.170726 16.496917 25.21875 15.375 C 25.70603 14.712226 26 13.885103 26 13 C 26 10.792 24.208 9 22 9 z "
       id="path3194" />
  </g>
</svg>
EOF;

echo $SVG;

?>