<?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 qdd45.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="22.627417"
     inkscape:cx="23.498285"
     inkscape:cy="22.861489"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     height="{$taille}px"
     width="{$taille}px"
     inkscape:grid-points="true"
     showgrid="true"
     inkscape:window-width="1272"
     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
       sodipodi:type="arc"
       style="opacity:1;fill:black;fill-opacity:1;stroke:black;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="path5571"
       sodipodi:cx="7"
       sodipodi:cy="13"
       sodipodi:rx="2"
       sodipodi:ry="2"
       d="M 9 13 A 2 2 0 1 1  5,13 A 2 2 0 1 1  9 13 z"
       transform="translate(-1,-1)" />
    <path
       sodipodi:type="arc"
       style="opacity:1;fill:black;fill-opacity:1;stroke:black;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="path5573"
       sodipodi:cx="7"
       sodipodi:cy="13"
       sodipodi:rx="2"
       sodipodi:ry="2"
       d="M 9 13 A 2 2 0 1 1  5,13 A 2 2 0 1 1  9 13 z"
       transform="translate(15.5,-5.5)" />
    <path
       sodipodi:type="arc"
       style="opacity:1;fill:black;fill-opacity:1;stroke:black;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="path5575"
       sodipodi:cx="7"
       sodipodi:cy="13"
       sodipodi:rx="2"
       sodipodi:ry="2"
       d="M 9 13 A 2 2 0 1 1  5,13 A 2 2 0 1 1  9 13 z"
       transform="translate(32,-1)" />
    <path
       sodipodi:type="arc"
       style="opacity:1;fill:black;fill-opacity:1;stroke:black;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="path5577"
       sodipodi:cx="7"
       sodipodi:cy="13"
       sodipodi:rx="2"
       sodipodi:ry="2"
       d="M 9 13 A 2 2 0 1 1  5,13 A 2 2 0 1 1  9 13 z"
       transform="translate(7,-4.5)" />

    <path
       sodipodi:type="arc"
       style="opacity:1;fill:black;fill-opacity:1;stroke:black;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="path5579"
       sodipodi:cx="7"
       sodipodi:cy="13"
       sodipodi:rx="2"
       sodipodi:ry="2"
       d="M 9 13 A 2 2 0 1 1  5,13 A 2 2 0 1 1  9 13 z"
       transform="translate(24,-4)" />
    <path
       style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
       d="M 9,26 C 17.5,24.5 30,24.5 36,26 L 38,14 L 31,25 L 31,11 L 25.5,24.5 L 22.5,9.5 L 19.5,24.5 L 14,10.5 L 14,25 L 7,14 L 9,26 z "
       id="path5581"
       sodipodi:nodetypes="cccccccccccc" />
    <path
       style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
       d="M 9,26 C 9,28 10.5,28 11.5,30 C 12.5,31.5 12.5,31 12,33.5 C 10.5,34.5 10.5,36 10.5,36 C 9,37.5 11,38.5 11,38.5 C 17.5,39.5 27.5,39.5 34,38.5 C 34,38.5 35.5,37.5 34,36 C 34,36 34.5,34.5 33,33.5 C 32.5,31 32.5,31.5 33.5,30 C 34.5,28 36,28 36,26 C 27.5,24.5 17.5,24.5 9,26 z "
       id="path5583"
       sodipodi:nodetypes="ccccccccccc" />
    <path
       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:white;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
       d="M 11.5,30 C 15,29 30,29 33.5,30"
       id="path5585"
       sodipodi:nodetypes="cc" />
    <path
       style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:white;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
       d="M 12,33.5 C 18,32.5 27,32.5 33,33.5"
       id="path5587"
       sodipodi:nodetypes="cc" />
  </g>
</svg>
EOF;

echo $SVG;

?>