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)

Junior Member

5+ Year Member

joined:Aug 25, 2007
posts: 94
votes: 0

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 July 17, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 22, 2005
votes: 0

$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()


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members