Class Thumbnail

Description
  • author: Ian Selby, adjustments by Michael Botsko
  • version: 1.1 (PHP5) (modified)
  • copyright: Copyright 2006 Ian Selby 1.1 (PHP5) (modified)
  • abstract: PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.

Located in /thumbnail/Thumbnail.php (line 18)


	
			
Variable Summary
array $imageMeta
Method Summary
Thumbnail __construct (string $fileName)
void __destruct ()
void createReflection (int $percent, int $reflection, int $white, [bool $border = true], [string $borderColor = '#a4a4a4'])
void crop (int $startX, int $startY, int $width, int $height)
void cropFromCenter ([int $cropSize = false])
void resize ([int $maxWidth = 0], [int $maxHeight = 0])
void resizePercent ([int $percent = 0])
void rotateImage ([string $direction = 'CW'])
void save (string $name, [int $quality = 100])
void show ([int $quality = 100], [string $name = ''])
Variables
array $imageMeta (line 24)
  • var: Image meta data if any is available (jpeg/tiff) via the exif library
  • access: public
Methods
Constructor __construct (line 111)

Class constructor

  • access: public
Thumbnail __construct (string $fileName)
  • string $fileName
Destructor __destruct (line 214)
  • abstract: Class destructor
  • access: public
void __destruct ()
createReflection (line 558)
  • abstract: Creates Apple-style reflection under image, optionally adding a border to main image
  • access: public
void createReflection (int $percent, int $reflection, int $white, [bool $border = true], [string $borderColor = '#a4a4a4'])
  • int $percent
  • int $reflection
  • int $white
  • bool $border
  • string $borderColor
crop (line 459)
  • abstract: Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
  • access: public
void crop (int $startX, int $startY, int $width, int $height)
  • int $startX
  • int $startY
  • int $width
  • int $height
cropFromCenter (line 408)
  • abstract: Crops the image from calculated center in a square of $cropSize pixels
  • access: public
void cropFromCenter ([int $cropSize = false])
  • int $cropSize
getCurrentHeight (line 236)
  • abstract: Returns the current height of the image
  • access: public
int getCurrentHeight ()
getCurrentWidth (line 226)

Returns the current width of the image

  • access: public
int getCurrentWidth ()
resize (line 331)
  • abstract: Resizes image to maxWidth x maxHeight
  • access: public
void resize ([int $maxWidth = 0], [int $maxHeight = 0])
  • int $maxWidth
  • int $maxHeight
resizePercent (line 370)
  • abstract: Resizes the image by $percent percent
  • access: public
void resizePercent ([int $percent = 0])
  • int $percent
rotateImage (line 703)
  • abstract: Rotates image either 90 degrees clockwise or counter-clockwise
  • access: public
void rotateImage ([string $direction = 'CW'])
  • string $direction
save (line 544)
  • abstract: Saves image as $name (can include file path), with quality of # percent if file is a jpeh
  • access: public
void save (string $name, [int $quality = 100])
  • string $name
  • int $quality
show (line 502)
  • abstract: Outputs the image to the screen, or saves to $name if supplied. Quality of JPEG images can be controlled with the $quality variable
  • access: public
void show ([int $quality = 100], [string $name = ''])
  • int $quality
  • string $name

Documentation generated on Wed, 15 Apr 2009 17:03:41 -0700 by phpDocumentor 1.4.1