General Statistics
390 Tutorials
202 Total Votes
7 User(s) Online
975360 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 [ 14595 Views - 4 Votes ] [ Rate ]

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

External Thumbnail Creator
CODE
// If an image is found and we can determine that it is an image
if ( $pic )
{
// Get width and height from the image
$width = imagesx( $pic );
$height = imagesy( $pic );

// Width that thumbnail should be
$twidth = $_GET['width'];

If the image is found, we will use the functions imagesx() and imagesy() in order to get the width and image from the original image. We now will setup a variable holding the requested width of the image we will generate


CODE
// Valid width?
if ( !is_numeric( $twidth ) || $twidth <= 0 || !intval( $twidth ) || $twidth > $width )
{
exit();
}

We are now checking the values of the width to make sure they are valid in order to generate a thumbnail. If the width is not a number, less than or equal to zero, not an integar, or is greater than the original image's width, we will stop there. This means that we have people messing around with the script. We don't want that now do we.



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