homepage Welcome to WebmasterWorld Guest from 54.243.23.129
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Visit PubCon.com
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




msg:3953907
 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




msg:3954550
 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved