<?PHP

   
require "imageFiltersIndex.class.php";

// GD part
   
$img_src_file "825.jpg";
   
$img_src=ImageCreateFromJpeg($img_src_file);
 
// imageFiltersIndex
   
$imageFiltersIndex = new imageFiltersIndex;
   
$imageFiltersIndex->resource($img_src);

// Only for example reasons
if ($_GET["filterimg"])
{
    if ((!
method_exists($imageFiltersIndex,$_GET["filterimg"]) || $_GET["filterimg"] == "resource"))
    {
        die(
"This filter does not exists");
    }


    
$imageFiltersIndex->$_GET["filterimg"]();

    
header("Content-type: image/jpeg");
    
imagejpeg($img_src,"",50);
}
else
{
print <<<EOF

<html>
<head>
<title>imageFiltersIndex</title>

</head>

<body>


<br />
<div align="center">
 <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><a href="http://www.tehospedo.com.br/hospedagem-de-sites/"><img src="http://www.tehospedo.com.br/img/promocoes/selo3.gif" alt="Hospedagem de sites" width="102" height="30" border="0" /></a><br /><a href="http://www.tehospedo.com.br/hospedagem-de-sites/" title="Hospedagem de sites" style="color: #ADADAD;text-decoration: none;font-size:10px;font-family: Arial, Helvetica, sans-serif;">Hospedagem de Sites</a></td></tr></table> 
</div>


<table cellspacing="5" widht="100%">
<tr valign="top">

<td width="240" bgcolor="#DDCCFF">
<p> 
Este site &eacute; gentilmente hospedado pela TeHospedo, que oferece planos de <a href="http://www.tehospedo.com.br">hospedagem de sites</a> Linux e Windows.
</p>

<hr />

<p align="right">Go to <a href="/">author homepage - DarkElder</a> (in portuguese)</p>

</td>

<td>

<h1>imageFiltersIndex</h1>


<h2>What is?</h2>
<p>Is a PHP class (<a href="http://www.php.net">http://www.php.net</a>) that contains a set of filters that works around the image index, changing it.</p>
<p>Currently there are 3 filters on it:</p>
<ul>
<li>grayscale:                 Turn an image grayscale [since 1.0]</li>
<li>sepia:                    Turn an image older than it is [since 1.0]</li>
<li>yellowize:                 Add a yellow layer in the front of image (transparent or solid) [since 1.0]</li>
</ul>

<p>You can see more details about this project at <a href="http://darkelder.users.phpclasses.org/browse.html/package/890.html">our project</a> at PHPClasses.org.</p>
<ul>
<li><a href="http://darkelder.users.phpclasses.org/browse.html/package/890.html">Download</a> version 1.1</li>
<li><a href="view.php?f=index.php">View this example source</a></li>
<li><a href="view.php?f=imageFiltersIndex.class.php">View this class source</a></li>
</ul>

<h2>Example</h2>
<p>This is an example only page to imageFiltersIndex.</p>


<h3>Select a filter:</h3>
<ul>
EOF;
    
    foreach(
get_class_methods("imageFiltersIndex") as $filter)
    {
        if (
$filter == "resource") continue;

        
printf('<li><a href="index.php?filter=%s#image">%s</a></li>',$filter,$filter);
    }
}

print <<<EOF

</ul>
EOF;

if (
$_GET["filter"])
{
    
printf('<h3><a name="image">Filter %s</a></h3><img src="index.php?filterimg=%s" />',$_GET["filter"],$_GET["filter"]);
}

print <<<EOF
<h3>Original image:</h3>
<img src="825.jpg" />

</td>


<td width="340">
<a href="http://www.tehospedo.com.br/hospedagem-de-sites/" tilte="Hospedagem de sites"><img src="http://www.tehospedo.com.br/img/banners/promocao_parceiros/banner_336x280.jpg" alt="Hospedagem de sites" width="336" height="280" border="0"/></a>


</div>
</td>


</tr>
</table>


</body>
</html>
EOF;

?>