Guldstrand Posted July 20, 2009 Share Posted July 20, 2009 I need some advice / tips for a function that can create thumbnails (2 different sizes) from an external image (url), then save the file name/path in mysql. I´m working with a small portal for webcams, and I need to be able to download cam images (usually. Jpg) from users own websites, and then create thumbnails of them. Preferably any function that does not require too much of my server (RAM, CPU and bandwidth). Link to comment https://forums.phpfreaks.com/topic/166656-create-thumbnails-from-external-images/ Share on other sites More sharing options...
Guldstrand Posted July 20, 2009 Author Share Posted July 20, 2009 *bump* Link to comment https://forums.phpfreaks.com/topic/166656-create-thumbnails-from-external-images/#findComment-879073 Share on other sites More sharing options...
ldougherty Posted July 20, 2009 Share Posted July 20, 2009 You can use wget to grab the image from the remote server by specifying the URL then you use functions from the GD library to build your thumbnails from the original http://www.php.net/manual/en/ref.image.php Link to comment https://forums.phpfreaks.com/topic/166656-create-thumbnails-from-external-images/#findComment-879086 Share on other sites More sharing options...
The Little Guy Posted July 21, 2009 Share Posted July 21, 2009 I made this code, you will have modify it some to get it to do what you want it to do: http://beta.phpsnips.com/snippet.php?id=61 But it grabs an image from some web site and displays it. To save it, you need to add/Change these values: Change "NULL" to a file name for a jpg: imagejpeg($thumbImg, NULL, 100); Add a second parameter for a gif: imagegif($thumbImg); Change "NULL" to a file name for a png: imagepng($thumbImg, NULL, 9, PNG_ALL_FILTERS); Hope this helps! Link to comment https://forums.phpfreaks.com/topic/166656-create-thumbnails-from-external-images/#findComment-879109 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.