homepage Welcome to WebmasterWorld Guest from 23.22.173.58
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
resize and download image
hanyaz

5+ Year Member



 
Msg#: 3953905 posted 8:11 pm on Jul 16, 2009 (gmt 0)

hello,
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 ?
thanks
Yaz

 

NomikOS

5+ Year Member



 
Msg#: 3953905 posted 6:35 pm on Jul 17, 2009 (gmt 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)
imagecreatetruecolor
imagejpeg (png/gif)

then upload new file with copy()


Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved