our clients
Create a thumb from uploaded image
Check out how to quickly create a thumb from uploaded image.I assume that the Thumbnailer.php file is located in the same directory as the script below. If not change include path accordingly.
This example script will create a 120x90px Thumbnail for every uploaded image.
<?php
// create callback function
// which defines how to handle uploaded image
function callb(& $thumb) {
// resize image to 120x90px, round its corners and save
// to any directory under same filename
$thumb->thumbFixed(120,90)->round()->save('thumbs/'.$thumb->filename);
}
// call upload helper, first parameter refers to the file upload field name
// example html
// <input type="file" name="upload_name" />
// always use try-catch statement to catch errors
try {
Thumbnailer::upload('upload_name', 'callb');
}
catch (ThumbnailerException $e) {
die("Error number ".$e->getCode()." occured: ".$e->getMessage());
}
?>
Tutorials
-
How to install Wordpress 3
09/04/2011Installing Wordpress is easy and fun
-
Installing MySQL Windows
09/03/2011We will teach you how to install MySQL and get it working in PHP in this step by step tutorial.
-
Installing PHP 5.3 with Apache on Windows
09/03/2011We will teach you how to install PHP as an Apache module in this step by step tutorial.
-
How to install Apache on Windows
09/03/2011We will teach you how to setup Apache environment on Windows in this step by step tutorial.
-
Understanding paths in PHP
03/05/2011Ever wondered how to properly include files? Here's your chance
-
Batch processing tutorial
03/01/2011In this example we will process many photos from directory and save information about them into the database.
-
Create a thumb from uploaded image
04/02/2010Check out how to quickly create a thumb from uploaded image.