title: How to crop and image before adding an overlay? (GD) (PHP)
body: <p>My code so far (it creates an overlay to a youtube thumbnail):</p>
  
  <pre><code>&lt;?php
  header("Content-type:image/png");
  $background=imagecreatefromjpeg("http://img.youtube.com/vi/".$_GET['v']."/default.jpg");
  $insert=imagecreatefrompng("play.png");
  imagecolortransparent($insert,imagecolorat($insert,0,0));
  $insert_x=imagesx($insert);
  $insert_y=imagesy($insert);
  imagecopymerge($background,$insert,5,57,0,0,$insert_x,$insert_y,100);
  imagepng($background,NULL);
  </code></pre>
  
  <p>The output image is 120x90px, but i need it to have 90x90px.</p>
  
  <p>Anyone knows how this is possible?</p>
  
  <p>Thanks in advance!</p>