Greetings all, I have a real simple function. I works well on JPG images but ImageCopyResized(), or ImagePNG() doesn't seem to be working. When I view the uploaded file it is still it's original size. Here is the function. I hope someone can help me, I'm pretty stumped.


function transform_to_profile_pic() { $path = $this->origpath; $type = $this->type;

      # make jpg or png image
      $img_dst = imagecreatetruecolor(PROFILE_IMAGE_W,PROFILE_IMAGE_H);
      if($type == 2)
         $img_src = imagecreatefromjpeg($path);
      else if($type == 3)
         $img_src = imagecreatefrompng($path);

# Overwrite the original with the resized image to the filesystem
imagecopyresized($img_dst, $img_src, 0, 0, 0, 0, PROFILE_IMAGE_W, PROFILE_IMAGE_H, imagesx($img_src), imagesy($img_src)
if($type == 2)
imagejpeg($img_dst, $path, 100);
else if($type == 3)
imagepng($img_dst, $path . ".png", 100);
}


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to