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 Alfred R. Baudisch  >  Thumbnails Creation  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Usage example of thumbs class
Class: Thumbnails Creation
Generate smooth thumbnail images
Author: By
Last change: Now it shows other way of using the class.
Date: 2004-08-01 14:34
Size: 1,067 bytes
 

Contents

Class file image Download
<?php
/**
* Usage example of "thumbs" class.
*/
require "class.thumbs.php";

/**
* Your photos are in the directory "photos".
* The class will generate the thumbnails into the directory> "photos/thumbs/", with the default settings.
*/
$thumbs = new thumbs("./photos/");
$thumbs->creates_thumbs();

/**
* Create grayscale thumbnails
*/
$thumbs->_directory "./photos/";
$thumbs->_thumbs_directory "gray/";
$thumbs->_thumbs_name "_gray";
$thumbs->_gray_scale true;
$thumbs->creates_thumbs();

exit;

/**
* The class will generate the thumbnails into the directory> "photos/thumbs/".
* And all thumbs will be 120x120 px and JPEG Quality of 50%
*/
$thumbs = new thumbs("photos/"0"thumbs/"false0100false120120);
$thumbs->creates_thumbs();

/**
* The class will generate the thumbnails into the directory> "photos/". But the name of they will be:
* "nameoforiginalphoto_thumb.ext", "nameoforiginalphoto2_thumb.ext", etc..
*/
$thumbs = new thumbs("./photos/"falsefalse"_thumb");
$thumbs->creates_thumbs();
?>