title: PHP : Imagecopy and Imagecopymerge don't work with two png
body: <p>I would put a logo image in another image, the two images are png, I try both functions imagecopy and imagecopymerge but nothing to do, I do not see the result when I open the image on the disk, however both functions returns true. Someone can help me, here is the code I use:</p>
  
  <pre><code>     $data = substr($_POST['imageData'], strpos($_POST['imageData'], ",") + 1);
       $decodedData = base64_decode($data);
       $img = "assets\\images\\simulation\\user\\img777.png";
       $srcpath =  "assets\\images\\logo.png";
       fp = fopen($img , 'wb');
       fwrite($fp, $decodedData);
       fclose($fp);//work until this place
       $dest =imagecreatefrompng($img);
       $src =imagecreatefrompng($srcpath);
       imagecopy ($dest,$src, 0, 0, 0, 0, imagesx($src),imagesy($src));
  
       // or imagecopymerge ($dest,$src, 0, 0, 0, 0, imagesx($src),imagesy($src), $pct); with $pct =0 or 50
  
       /*or i have also try :  $cut = imagecreatetruecolor(imagesx($src),imagesy($src));
          imagecopy($cut, $dest, 0, 0, 0, 0, imagesx($src),imagesy($src));
          imagecopy($cut, $src, 0, 0, 0, 0, imagesx($src),imagesy($src));
          imagecopymerge ($dest,$cut, 0, 0, 0, 0, imagesx($src),imagesy($src), $pct); with $pct =0 or 50*/
  </code></pre>
  
  <p>here are a example for the image logo.png : <a href="http://upload.wikimedia.org/wikipedia/commons/4/48/EBay_logo.png" rel="nofollow">http://upload.wikimedia.org/wikipedia/commons/4/48/EBay_logo.png</a></p>
  
  <p>Here are the other image.png : <a href="http://www.noelshack.com/2014-40-1412264764-img68634dxn777.png" rel="nofollow">http://www.noelshack.com/2014-40-1412264764-img68634dxn777.png</a></p>
  
  <p>the result it's the same that image.png ...</p>
  
  <p>can you help me, thanks.</p>