Class Image_Transform_Driver_GD

Description

The main "Image_Resize" class is a container and base class which provides the static methods for creating Image objects as well as some utility functions (maths) common to all parts of Image Resize.

The object model of DB is as follows (indentation means inheritance):

Image_Resize The base for each Image implementation. Provides default | implementations (in OO lingo virtual methods) for | the actual Image implementations as well as a bunch of | maths methods. | +-Image_GD The Image implementation for the PHP GD extension . Inherits Image_Resize When calling DB::setup for GD images the object returned is an instance of this class.

Located in /plugins/ImageManager/Classes/GD.php (line 47)

Image_Transform
   |
   --Image_Transform_Driver_GD
Variable Summary
 mixed $imageHandle
 mixed $old_image
Method Summary
 none addText (array $params)
 void crop (mixed $new_x, mixed $new_y, mixed $new_width, mixed $new_height, int $crop_x, int $crop_y, int $crop_width, int $crop_height)
 none display ([string $type = ''], [int $quality = 75])
 void flip (boolean $horizontal)
 none free ()
 none gamma ([mixed $outputgamma = 1.0], float $outputgamma )
 mixed load (string $image)
 mixed rotate (int $angle, [array $options = null])
 none save ($filename $filename, [$quality $type = ''], [$types $quality = 85])
 true _resize ($new_x $new_x, $new_y $new_y)
Variables
mixed $imageHandle = '' (line 52)

Holds the image file for manipulation

mixed $old_image = '' (line 57)

Holds the original image file

Inherited Variables

Inherited from Image_Transform

Image_Transform::$image
Image_Transform::$img_x
Image_Transform::$img_y
Image_Transform::$lapse_time
Image_Transform::$lib_path
Image_Transform::$new_x
Image_Transform::$new_y
Image_Transform::$resized
Image_Transform::$type
Image_Transform::$uid
Methods
addText (line 109)

addText

  • see: PEAR::isError()
none addText (array $params)
  • array $params: options Array contains options array( 'text' The string to draw 'x' Horizontal position 'y' Vertical Position 'Color' Font color 'font' Font to be used 'size' Size of the fonts in pixel 'resize_first' Tell if the image has to be resized before drawing the text )

Redefinition of:
Image_Transform::addText()
crop (line 372)

Crop the image

void crop (mixed $new_x, mixed $new_y, mixed $new_width, mixed $new_height, int $crop_x, int $crop_y, int $crop_width, int $crop_height)
  • int $crop_x: left column of the image
  • int $crop_y: top row of the image
  • int $crop_width: new cropped image width
  • int $crop_height: new cropped image height

Redefinition of:
Image_Transform::crop()
display (line 473)

Display image without saving and lose changes

none display ([string $type = ''], [int $quality = 75])
  • string $type: type (JPG,PNG...);
  • int $quality: quality 75

Redefinition of:
Image_Transform::display()
Place holder for the real display method used by extended methods to do the resizing
flip (line 398)

Flip the image horizontally or vertically

void flip (boolean $horizontal)
  • boolean $horizontal: true if horizontal flip, vertical otherwise

Redefinition of:
Image_Transform::flip()
free (line 495)

Destroy image handle

none free ()

Redefinition of:
Image_Transform::free()
Place holder for the real free method used by extended methods to do the resizing
gamma (line 433)

Adjust the image gamma

none gamma ([mixed $outputgamma = 1.0], float $outputgamma )
  • float $outputgamma

Redefinition of:
Image_Transform::gamma()
Image_Transform_GD (line 66)

Check settings

  • return: true or or a PEAR error object on error
  • see: PEAR::isError()
mixed Image_Transform_GD ()
load (line 79)

Load image

  • return: none or a PEAR error object on error
  • see: PEAR::isError()
mixed load (string $image)
  • string $image: filename

Redefinition of:
Image_Transform::load()
Place holder for the real load method used by extended methods to do the resizing
rotate (line 157)

Rotate image by the given angle Uses a fast rotation algorythm for custom angles or lines copy for multiple of 90 degrees

  • return: none or a PEAR error object on error
  • see: PEAR::isError()
  • author: Pierre-Alain Joye
mixed rotate (int $angle, [array $options = null])
  • int $angle: Rotation angle
  • array $options: array( 'autoresize'=>true|false, 'color_mask'=>array(r,g,b), named color or #rrggbb )
save (line 447)

Save the image file

none save ($filename $filename, [$quality $type = ''], [$types $quality = 85])
  • $filename $filename: string the name of the file to write to
  • $quality $type: int output DPI, default is 85
  • $types $quality: string define the output format, default is the current used format

Redefinition of:
Image_Transform::save()
Place holder for the real save method used by extended methods to do the resizing
_resize (line 341)

Resize Action

For GD 2.01+ the new copyresampled function is used It uses a bicubic interpolation algorithm to get far better result.

  • return: on success or pear error
  • see: PEAR::isError()
true _resize ($new_x $new_x, $new_y $new_y)
  • $new_x $new_x: int new width
  • $new_y $new_y: int new height

Inherited Methods

Inherited From Image_Transform

 Image_Transform::addBorder()
 Image_Transform::addDropShadow()
 Image_Transform::addText()
 Image_Transform::cleanUp()
 Image_Transform::colorarray2colorhex()
 Image_Transform::colorhex2colorarray()
 Image_Transform::createUnique()
 Image_Transform::crop()
 Image_Transform::display()
 Image_Transform::factory()
 Image_Transform::flip()
 Image_Transform::free()
 Image_Transform::gamma()
 Image_Transform::getImageType()
 Image_Transform::getWebSafeFormat()
 Image_Transform::load()
 Image_Transform::resize()
 Image_Transform::save()
 Image_Transform::scale()
 Image_Transform::scaleByFactor()
 Image_Transform::scaleByLength()
 Image_Transform::scaleByPercentage()
 Image_Transform::scaleMaxX()
 Image_Transform::scaleMaxY()
 Image_Transform::uniqueStr()
 Image_Transform::_get_image_details()
 Image_Transform::_set_img_x()
 Image_Transform::_set_img_y()
 Image_Transform::_set_new_x()
 Image_Transform::_set_new_y()

Documentation generated on Mon, 13 Jun 2005 20:27:36 -0400 by phpDocumentor 1.3.0RC3