title: png image being cropped when saved from base64_decode
body: <p>I'm trying to create an image in my server's uploads directory from base64 code sent from the client-side. Below's the code for same :</p>
  
  <pre><code>&lt;?php
      $dataURI = $_REQUEST['dataURI'];
  
      $dataURI = str_replace('data:image/png;base64,', '', $dataURI);
      $dataURI = str_replace(' ', '+', $dataURI);
  
      $data = base64_decode($dataURI);
  
      // $filename = UPLOAD_DIR . uniqid() . '.png';
      $filename = UPLOAD_DIR . 'saved-image' . '.png';
  
      $status = file_put_contents($filename, $data);
  
  ?&gt;
  </code></pre>
  
  <p>the image is successfully created, but for some reason the image is cropped to half(horizontally). Could anyone tell me , what's wrong with this ? </p>
  
  <p>Below is the original and saved/created image : </p>
  
  <p>Original Image</p>
  
  <p><img src="https://farm8.staticflickr.com/7283/8741490620_5aaaf057e5.jpg"> </p>
  
  <p>Created Image</p>
  
  <p><img src="https://farm8.staticflickr.com/7282/8741491818_0c034ecfbc.jpg"></p>