title: Image getting cropped using imagepng. How should i avoid that?
body: <p>I am trying to functions:
   1. imagecreatefrompng 2. imagepng</p>
  
  <p>my php code looks like this:</p>
  
  <pre><code>&lt;?php
  ini_set('memory_limit', -1);
  
  try{
      //if(!$image=imagecreatefromjpeg('zee3.jpg')){
     if(!$image=imagecreatefrompng('leo.png')){
        throw new Exception('Error loading image');
     }
     imagepng($image, 'leoAfter_9compression1.png', 9);
     // free up memory
     imagedestroy($image);
  }
  catch(Exception $e){
     echo $e-&gt;getMessage();
     exit();
  }
  
  ini_restore('memory_limit');
  
  ?&gt;
  </code></pre>
  
  <p>The image leo.png a 3MB file</p>
  
  <p>But after running the code leoAfter_9compression1.png image come out to be 1.7MB file. but it is getting cropped. Which i do not want. </p>
  
  <p>And i am unable to understand why is that happening. </p>
  
  <p>Can someone tell me the reason to image getting cropped, and how can i avoid it. </p>
  
  <p><strong>If someone wants to test for the image i am talking about, search "image" leo.png on google. it will the first image on the search. 
  The image gets cropped as well as distorted. 
  But i tried the same algorithm for a different image, and its works fine on that.</strong>  </p>
  
  <p>Regards
  Zeeshan</p>