PHP Classes

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Daniel Thul  >  Thumbnail Creator  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: An example script
Class: Thumbnail Creator
Generate thumbnails from JPEG images
Author: By
Last change:
Date: 9 years ago
Size: 1,279 bytes


Class file image Download
require("class.thumb.php");//Here the class itself is included
$thumb = new thumb;//The class is started
//If you want to test this class, you need a picture called "bild.jpg"
$thumb->picture = "bild.jpg";//Here you save the name of the picture
/*The index must be a number between 0 and 101
If you choose for example $thumb->index = "2", the Thumbnail will be as half as greate as the original picture
For savety is cared enough, because this class will work only with datas from the type image/jpeg or image/jpg
and it checks if the index is a number and between 0 and 101. If the variable picture is no image the script will
not work and end with exit(). If $index is not a number or not between 0 and 101 it will be set to 2.
Everybody can use this class freely and give it around, but with a note, so that everybody can see who is tha author and his E-Mail adress (Daniel Thul,
If you use this class, I would like if you write me an E-Mail, because I would like to see if anybody uses my class.
Feel free to report me bugs or ideas for improvements. :-)*/
$thumb->index = "1.5";//Here the index is set
$thumb->create();//This function creates the thumbnail and sends the picture with a header for the type "image/jpeg" to the browser