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 Pascal Rehfeldt  >  Thumbnailer  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: demonstrates how to use thumbnailer
Class: Thumbnailer
Generate thumbnails using GD, ImageMagick or Exif
Author: By
Last change:
Date: 10 years ago
Size: 2,063 bytes
 

Contents

Class file image Download
<?php

 
/**********************************************************************

   Projectname: Thumbnailer
   Version: 0.1
   Author: Pascal Rehfeldt <Pascal@Pascal-Rehfeldt.com>
   Last modified: 24 May 2005
   Copyright (C): 2005 Pascal Rehfeldt, all rights reserved

   * GNU General Public License (Version 2, June 1991)
   *
   * This program is free software; you can redistribute
   * it and/or modify it under the terms of the GNU
   * General Public License as published by the Free
   * Software Foundation; either version 2 of the License,
   * or (at your option) any later version.
   *
   * This program is distributed in the hope that it will
   * be useful, but WITHOUT ANY WARRANTY; without even the
   * implied warranty of MERCHANTABILITY or FITNESS FOR A
   * PARTICULAR PURPOSE. See the GNU General Public License
   * for more details.

   Description:
   Example for thumbnailer

  **********************************************************************/

 
require('./thumbnailer.class.php');

 
$image = './image.jpg'; // Image to create thumbnail from
 
$tempdir = './'; // Temporaray directory
 
$strategie = 'gd'; // Strategie [gd|im|exif] (default: gd)
 
$x = 200; // New X size (default: 100)
 
$y = 200; // New Y size (default: 100)
 
$convert = 'convert'; // ImageMagick Convert Command (default: '')

  // Example with all possible parameters
 
$thumb = new thumbnailer($image, $tempdir, $strategie, $x, $y, $convert);

 
// Minimum parameter count
  //$thumb = new thumbnailer($image, $tempdir);

  // Write thumbnail to browser
 
$thumb->showThumbnail();

 
// Save thumbnail to disk
  //$thumb->saveThumbnail('./' . time() . '.png');

  // Get all errormessages as an plaintext array
  //print_r($thumb->getErrorMsg());

  // Show all errormessages as an image
  //$thumb->getImageError();

?>