title: PNG image showing black background on uploading/resizing
body: <p>I am uploading a image and its resizing, but on PNG, its showing black Background.</p>
  
  <p>Can you please check the code and let me know what is the issue? </p>
  
  <pre><code>$newImageWidth = ceil($width * $scale);
          $newImageHeight = ceil($height * $scale);
          $newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);
          if ($ext == "jpg" || $ext == "jpeg")
          {
              $source = imagecreatefromjpeg($image);
          }
          else
          if ($ext == "png")
          {
              $source = imagecreatefrompng($image);
          }
          else
          {
              $source = imagecreatefromgif($image);
          }
  
          imagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);
          imagejpeg($newImage,$image,90);
          chmod($image, 0777);
          return $image;
  </code></pre>