Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Yasir Siddiqui  >  PHP Create Thumbnail Images  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: PHP Create Thumbnail Images
Generate thumbnail images to fit a given size
Author: By
Last change:
Date: 1 year ago
Size: 2,272 bytes
 

Contents

Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Example</title>
</head>
<body>
<?php

include_once 'thumbnail.class.php';

$obj = new Thumbnail();
?>
<div style="float:left; mergin-left:10px;">
<?php

$thumbnail 
$obj->generateThumbnail("./DSC00722.JPG""./DSC00722.JPG_thumb1.JPG"5050);

if(
$thumbnail) {
?>    
    
    <div style="width:50px; height:50px; border:#F00 2px solid; display: table-cell; text-align: center; vertical-align: middle;">
    <img src="<?php echo $thumbnail;?>">
    </div>
<?php     
}
?>
</div>
<div style="float:left;  margin-left:10px;">
<?php 

$thumbnail 
$obj->generateThumbnail("./DSC00778.JPG""./DSC00778.JPG_thumb2.JPG"100110);

if(
$thumbnail) {
?>
    <div style="width:100px; height:110px; border:#F00 2px solid; display: table-cell; text-align: center; vertical-align: middle;">
    <img src="<?php echo $thumbnail;?>"></div>

<?php 
}

?>
</div>

<div style="float:left; margin-left:10px;">
<?php 

$thumbnail 
$obj->generateThumbnail("./IMG_3994.JPG""./IMG_3994.JPG_thumb3.JPG"190290);
if(
$thumbnail) {
?>
    <div style="width:190px; height:290px; border:#F00 2px solid; display: table-cell; text-align: center; vertical-align: middle;">
    <img src="<?php echo $thumbnail;?>"></div>
    
<?php
}    
?>
</div>

<div style="float:left; margin-left:10px;">
<?php 

$thumbnail 
$obj->generateThumbnail("./IMG_3994.JPG""./IMG_3994.JPG_thumb4.JPG"180160);
if(
$thumbnail) {
?>
    <div style="width:180px; height:160px; border:#F00 2px solid; display: table-cell; text-align: center; vertical-align: middle;">
    <img src="<?php echo $thumbnail;?>"></div>
    
<?php
}    
?>
</div>

<div style="float:left;  margin-left:10px;">
<?php

$thumbnail 
$obj->generateThumbnail("./DSC00722.JPG""./DSC00722_thumb5.JPG"300,200);

if(
$thumbnail) {
?>    
    
    <div style="width:300px; height:200px; border:#F00 2px solid; display: table-cell; text-align: center; vertical-align: middle;">
    <img src="<?php echo $thumbnail;?>">
    </div>
<?php     
}
?>
</div>

</body>
</html>