PHP Classes

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Roberto Bertó  >  imageFiltersIndex  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: An example file that is running at
Class: imageFiltersIndex
A set of filters that works around the image index
Author: By
Last change: Fixed a typo and the filename
Date: 12 years ago
Size: 2,516 bytes


Class file image Download

require "imageFiltersIndex.class.php";

// GD part
$img_src_file = "825.jpg";

// imageFiltersIndex
$imageFiltersIndex = new imageFiltersIndex;

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


header("Content-type: image/jpeg");
print <<<EOF


<table width="100%">
<tr valign="top">

<h2>What is?</h2>
<p>Is a PHP class (<a href=""></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>
<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>

<p>You can see more details about this project at <a href="">our project</a> at</p>
<li><a href="">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>

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

<h3>Select a filter:</h3>
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


if (
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="
$img_src_file" />

<script type="text/javascript" src=""></script>