Image Name: " . $imgName . "
"; print "Image Type: " . $imgType . "
"; print "Thumb Name: " . $thumbName . "
"; print "Image Location: " . $imgLoc . "
"; print "Thumb Location: " . $thumbLoc . "
"; print "Width: " . $width . "
"; print "Height: " . $height . "
"; print "Type Alpha: " . $type . "
"; print "Attribute: " . $attr . "
"; //****************************************\\ //FIND THE NEW SIZE OF THE THUMBNAIL IMAGE\\ //****************************************\\ $thumbSize=150; /* x 600 600 Here's the math ----- = ----- =>> x = ----- * 100 100 800 800 */ if ($width > $height) { $thumbWidth = $thumbSize; $thumbHeight = $thumbSize*($height/$width); print "New Width: ".$thumbWidth."
New Height: ".$thumbHeight."
"; } if ($width < $height) { $thumbHeight = $thumbSize; $thumbWidth = $thumbSize*($width/$height); print "New Width: ".$thumbWidth."
New Height: ".$thumbHeight."
"; } if ($width == $height) { $thumbHeight = $thumbSize; $thumbWidth = $thumbSize; print "New Width: ".$thumbWidth."
New Height: ".$thumbHeight."
"; } //*******************************************\\ //TEST TO SEE IF THE IMAGE IS A JPEG OR A GIF\\ //*******************************************\\ //jpeg if ($imgType == "image/jpeg") { print "JPEG IMAGE!!!
"; //*******************************************\\ //UNCOMMENT TO GET A WORKING EXAMPLE OF CODE \\ //*******************************************\\ //$sourceImage=imagecreatefromjpeg($imgLoc); //$destinImage=ImageCreateTrueColor($thumbWidth,$thumbHeight); //imagecopyresampled($destinImage,$sourceImage,0,0,0,0,$thumbWidth,$thumbHeight,$width,$height); //imagejpeg($destinImage, $thumbLoc, 100); imagedestroy($destinImage); imagedestroy($sourceImage); } //gif if ($imgType == "image/gif") { } } print "Type: $imgType
"; print "
"; print "
"; print "Copy Done....
"; }else{ print "
Could Not Copy, Wrong Filetype (".$imgName.")
"; } ?>