Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

resize and download image

8:11 pm on Jul 16, 2009 (gmt 0)

5+ Year Member

I would like to download and then resize an image with php from one server to another. Is it possible ? What would be the best way to do so ?
6:35 pm on Jul 17, 2009 (gmt 0)

10+ Year Member

$content = file_get_contents($url); 
file_put_contents (PATH_TO_IMAGE . $img, $content);

$img_filename_ = PATH_TO_IMAGE . $img;
if (file_exists($img_filename_))
$size = getimagesize($img_filename_);
# to resize use rule of three

then use:
imagecreatefromjpeg (png/gif)
imagejpeg (png/gif)

then upload new file with copy()


Featured Threads

Hot Threads This Week

Hot Threads This Month