- Forums
- Scripts
- How To Create Thumbnail Pictures Using Php And Save File
This Page Contains information about How To Create Thumbnail Pictures Using Php And Save File By wallpaperama in category Scripts with 0 Replies. [1346], Last Updated: Sat May 18, 2024
wallpaperama
Thu Apr 16, 2009
0 Comments
1046 Visits
today i wrote a function you can use to create thumbnails in your php script -how to create thumbnail images using php? well if you are asking yourself how here i will show you. just use this function
i have a cool wallpaper website and this is what i use to crete and make the thumbnail pictures. the images that are shrink and made smaller or you can also make it bigger using this code. it used gd library which is pretty standard in most hosting company
function createThumbs( $WallpaperamaSourceFile,$WallpaperamaDestinationFile,$WallpaperamaWidth,$WallpaperamaHeight,$OriginalWidth,$OriginalHeight )
{
# FUNCTION PROVIDED BY WWW.WALLPAPERAMA.COM *** PLEASE LEAVE THIS HERE ***
$tn = imagecreatetruecolor($WallpaperamaWidth, $WallpaperamaHeight) ;
$image = imagecreatefromjpeg($WallpaperamaSourceFile) ;
imagecopyresized($tn, $image, 0, 0, 0, 0, $WallpaperamaWidth, $WallpaperamaHeight, $OriginalWidth, $OriginalHeight) ;
imagejpeg($tn, $WallpaperamaDestinationFile, 100) ;
}