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