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 Stigmat  >  Thumbnail Images  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Thumbnail Images
Generate smooth thumbnail images
Author: By
Last change:
Date: 7 years ago
Size: 4,616 bytes
 

Contents

Class file image Download
<?php

require_once("thumbnail_images.class.php");

// example 1
$obj_img = new thumbnail_images();
$obj_img->PathImgOld 'img_old_1.jpg';
$obj_img->PathImgNew 'img_new_1.jpg';
$obj_img->NewWidth 100;
$obj_img->NewHeight 75;
if (!
$obj_img->create_thumbnail_images()) echo "error"
else {
echo <<<EOD
<table width="80%" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>150 x 150 jpg</td>
<td>100 x 75 jpg</td>
</tr>
<tr>
<td width="50%" valign="top"><img src="img_old_1.jpg" width="150" height="150" border="0"></td>
<td width="50%" valign="top"><img src="img_new_1.jpg" width="100" height="75" border="0"></td>
</tr>
</table>
<HR WIDTH="80%" SIZE="2" align="left" color="#000">
EOD;
}


// example 2
$obj_img = new thumbnail_images();
$obj_img->PathImgOld 'img_old_2.jpg';
$obj_img->PathImgNew 'img_new_2.jpg';
$obj_img->NewWidth 100;
$obj_img->NewHeight 100;
if (!
$obj_img->create_thumbnail_images()) echo "error"
else {
echo <<<EOD
<table width="80%" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>90 x 70 jpg</td>
<td>100 x 100 jpg</td>
</tr>
<tr>
<td width="50%" valign="top"><img src="img_old_2.jpg" width="90" height="70" border="0"></td>
<td width="50%" valign="top"><img src="img_new_2.jpg" width="100" height="100" border="0"></td>
</tr>
</table>
<HR WIDTH="80%" SIZE="2" align="left" color="#000">
EOD;
}

// example 3
$obj_img = new thumbnail_images();
$obj_img->PathImgOld 'img_old_3.jpg';
$obj_img->PathImgNew 'img_new_3.jpg';
$obj_img->NewWidth 200;
$obj_img->NewHeight 100;
if (!
$obj_img->create_thumbnail_images()) echo "error"
else {
echo <<<EOD
<table width="80%" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>300 x 300 jpg</td>
<td>200 x 100 jpg</td>
</tr>
<tr>
<td width="50%" valign="top"><img src="img_old_3.jpg" width="300" height="300" border="0"></td>
<td width="50%" valign="top"><img src="img_new_3.jpg" width="200" height="100" border="0"></td>
</tr>
</table>
<HR WIDTH="80%" SIZE="2" align="left" color="#000">
EOD;
}


// example 4
$obj_img = new thumbnail_images();
$obj_img->PathImgOld 'img_old_4.gif';
$obj_img->PathImgNew 'img_new_4.gif';
$obj_img->NewWidth 100;
$obj_img->NewHeight 100;
if (!
$obj_img->create_thumbnail_images()) echo "error"
else {
echo <<<EOD
<table width="80%" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>132 x 200 gif</td>
<td>100 x 100 gif</td>
</tr>
<tr>
<td width="50%" valign="top"><img src="img_old_4.gif" width="132" height="200" border="0"></td>
<td width="50%" valign="top"><img src="img_new_4.gif" width="100" height="100" border="0"></td>
</tr>
</table>
<HR WIDTH="80%" SIZE="2" align="left" color="#000">
EOD;
}


// example 5
$obj_img = new thumbnail_images();
$obj_img->PathImgOld 'img_old_5.png';
$obj_img->PathImgNew 'img_new_5.png';
$obj_img->NewWidth 200;
$obj_img->NewHeight 100;
if (!
$obj_img->create_thumbnail_images()) echo "error"
else {
echo <<<EOD
<table width="80%" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>279 x 530 png</td>
<td>200 x 100 png</td>
</tr>
<tr>
<td width="50%" valign="top"><img src="img_old_5.png" width="279" height="530" border="0"></td>
<td width="50%" valign="top"><img src="img_new_5.png" width="200" height="100" border="0"></td>
</tr>
</table>
<HR WIDTH="80%" SIZE="2" align="left" color="#000">
EOD;
}

// example 6
$obj_img2 = new thumbnail_images();
$obj_img2->PathImgOld 'img_old_6.jpg';
$obj_img2->PathImgNew 'img_new_6.jpg';
$obj_img2->NewWidth 100;
//$obj_img2->NewHeight = 75;
if (!$obj_img2->create_thumbnail_images()) echo "error"
else {
echo <<<EOD
<table width="80%" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>150 x 150 jpg</td>
<td>100 x (*) jpg</td>
</tr>
<tr>
<td width="50%" valign="top"><img src="img_old_6.jpg" width="150" height="150" border="0"></td>
<td width="50%" valign="top"><img src="img_new_6.jpg" width="100" height="100" border="0"></td>
</tr>
</table>
<HR WIDTH="80%" SIZE="2" align="left" color="#000">
EOD;
}

// example 7
$obj_img3 = new thumbnail_images();
$obj_img3->PathImgOld 'img_old_7.jpg';
$obj_img3->PathImgNew 'img_new_7.jpg';
//$obj_img3->NewWidth = 100;
$obj_img3->NewHeight 100;
if (!
$obj_img3->create_thumbnail_images()) echo "error"
else {
echo <<<EOD
<table width="80%" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>196 x 300 jpg</td>
<td>(*) x 100 jpg</td>
</tr>
<tr>
<td width="50%" valign="top"><img src="img_old_7.jpg" width="196" height="300" border="0"></td>
<td width="50%" valign="top"><img src="img_new_7.jpg" width="66" height="100" border="0"></td>
</tr>
</table>
<HR WIDTH="80%" SIZE="2" align="left" color="#000">
EOD;
}


?>