<?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 nll45.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="16"
     inkscape:cx="24.795834"
     inkscape:cy="23.520246"
     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="fill:white;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
       d="M 22,10 C 32.5,11 38.5,18 38,39 L 15,39 C 15,30 25,32.5 23,18"
       id="path3491"
       sodipodi:nodetypes="cccc" />
    <path
       style="fill:white;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
       d="M 24,18 C 24.384461,20.911278 18.447064,25.368624 16,27 C 13,29 13.180802,31.342892 11,31 C 9.95828,30.055984 12.413429,27.962451 11,28 C 10,28 11.187332,29.231727 10,30 C 9,30 5.9968392,30.999999 6,26 C 6,24 12,14 12,14 C 12,14 13.885866,12.097871 14,10.5 C 13.273953,9.505631 13.5,8.5 13.5,7.5 C 14.5,6.5 16.5,10 16.5,10 L 18.5,10 C 18.5,10 19.281781,8.0080745 21,7 C 22,7 22,10 22,10"
       id="path3495"
       sodipodi:nodetypes="csccccccccccc" />
    <path
       sodipodi:type="arc"
       style="opacity:1;fill:black;fill-opacity:1;stroke:black;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="path3499"
       sodipodi:cx="8.5"
       sodipodi:cy="23.5"
       sodipodi:rx="0.5"
       sodipodi:ry="0.5"
       d="M 9 23.5 A 0.5 0.5 0 1 1  8,23.5 A 0.5 0.5 0 1 1  9 23.5 z"
       transform="translate(0.5,2)" />
    <path
       sodipodi:type="arc"
       style="opacity:1;fill:black;fill-opacity:1;stroke:black;stroke-width:1.50000052;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="path3501"
       sodipodi:cx="14.5"
       sodipodi:cy="15.5"
       sodipodi:rx="0.5"
       sodipodi:ry="1.5"
       d="M 15 15.5 A 0.5 1.5 0 1 1  14,15.5 A 0.5 1.5 0 1 1  15 15.5 z"
       transform="matrix(0.866025,0.5,-0.5,0.866025,9.692632,-5.173394)" />

    <path
       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
       d="M 37,39 C 38,19 31.5,11.5 25,10.5"
       id="path8049"
       sodipodi:nodetypes="cc" />
  </g>
</svg>
EOF;

echo $SVG;

?>