General Statistics
390 Tutorials
202 Total Votes
7 User(s) Online
974772 Views Total
3000 Registered Members
24734 Posts Total
Rooneyfeld is our newest member
About this Tutorial: External Thumbnail Creator
External Thumbnail Creator
Rated 4 / 4 Votes

External Thumbnail Creator

Create a thumbnail of any image on the internet. Take advantage of the predefined image functions!


Date Added: December 7, 2005 [ 14576 Views - 4 Votes ] [ Rate ]

Author: Chaos King [ PHP Coding ] [ 8 Comment(s) ]

External Thumbnail Creator
CODE
// Checks if URL is image
if ( $img[2] == 1 )
{
$pic = imagecreatefromgif( $url ) or die();
}
else if ( $img[2] == 2 )
{
$pic = imagecreatefromjpeg( $url ) or die();
}
else if ( $img[2] ==3 )
{
$pic = imagecreatefrompng( $url ) or die();
}
else
{
exit();
}

Now, we will make sure that the image requested is an actual image. We will be using element two of our function to check that. The three main image types that we will allow are gif, jpeg, png. If the image cannot be produced and it is a valid image, we will stop the script by using die(). If the image is one of those, we will use the correct function that matches our image type in order to create the thumbnail. If it is not an image, just we will just stop the process by using the exit() function.


Total Pages (4)
<<Prev 1 [2] 3 4 Next>>

Welcome User
Welcome Guest
( Login | Register )

Latest Tutorial Index - RSS Feed
Latest Resources - RSS Feed
Latest Tutorials - RSS Feed
Vote for Us
  • VixxIMG.com - Free Image Hosting, Free Myspace Image Hosting, Free Image Uploads
  • PageRank Plus - Google PageRank checking, with a twist.
Random Affilaites