Class thumbnail

Description

PhpThumbFactory Object

This class is responsible for making sure everything is set up and initialized properly, and returning the appropriate thumbnail class instance. It is the only recommended way of using this library, and if you try and circumvent it, the sky will fall on your head :)

Basic use is easy enough. First, make sure all the settings meet your needs and environment... these are the static variables defined at the beginning of the class.

Once that's all set, usage is pretty easy. You can simply do something like:

  1. $thumb PhpThumbFactory::create('/path/to/file.png');

Refer to the documentation for the create function for more information

Located in /legacy/thumbnail.class.php (line 65)


	
			
Variable Summary
static string $defaultImplemenation
static string $pluginPath
Method Summary
static GdThumb create ([string $filename = null], [ $options = array()])
Variables
static string $defaultImplemenation = DEFAULT_THUMBLIB_IMPLEMENTATION (line 78)

Which implemenation of the class should be used by default

Currently, valid options are:

  • imagick
  • gd
These are defined in the implementation map variable, inside the create function

  • access: public
static string $pluginPath = THUMBLIB_PLUGIN_PATH (line 87)

Where the plugins can be loaded from

Note, it's important that this path is properly defined. It is very likely that you'll have to change this, as the assumption here is based on a relative path.

  • access: public
Methods
static method create (line 105)

Factory Function

This function returns the correct thumbnail object, augmented with any appropriate plugins. It does so by doing the following:

  • Getting an instance of PhpThumb
  • Loading plugins
  • Validating the default implemenation
  • Returning the desired default implementation if possible
  • Returning the GD implemenation if the default isn't available
  • Throwing an exception if no required libraries are present

static GdThumb create ([string $filename = null], [ $options = array()])
  • string $filename: The path and file to load [optional]
  • $options

Documentation generated on Tue, 09 Aug 2011 09:05:39 +0200 by phpDocumentor 1.4.3