Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

createsquarethumbnail

This function will create a square thumbnail image from an already uploaded image on your server.

createsquarethumbnail

Quote

createsquarethumbnail ( string $filetype , string $origfile , string $thumbfile, integer $new_size )


Parameters
filetype

This function only supports three file types:
1 is .gif files
2 is .jpg files
3 is .png files

origfile
Complete path to the orginal file you want to create a square thumbnail of.

thumbfile
Complete path to the thumbnail file you want to create.

new_size
Max pixel size for thumbnail image.

Return Values
This function will not return anything.

Example
Code
<?php
require_once INCLUDES."photo_functions_include.php";
 
// Set variables
$origfile = IMAGES."banner.png";
$thumbfile = IMAGES."banner_squarethumb.png";
$new_size = 100;
 
// Determine file extention
$fileext = substr($origfile, strrpos($origfile, '.') + 1);
if ($fileext == "gif") { $filetype = 1;
} elseif ($fileext == "jpg") { $filetype = 2;
} elseif ($fileext == "png") { $filetype = 3;
} else { $filetype = false; }
 
// Create thumbnail
if ($filetype) {
 createsquarethumbnail($filetype, $origfile, $thumbfile, $new_size);
 echo "Image sucessfully thumb nailed!";
} else {
 echo "File type not supported!";
}
?>


Changelog
7.01.00 - Function added to PHPFusion