SimpleGallery
[ class tree: SimpleGallery ] [ index: SimpleGallery ] [ all elements ]

Class: SimpleGallery_Thumb

Source Location: /Thumb.php

Class Overview


Simple Gallery thumbnail creator


Variables

Constants

Methods



Class Details

[line 22]
Simple Gallery thumbnail creator



[ Top ]


Class Variables

$_file =

[line 72]

Image file path



Tags:

access:  protected

Type:   string


[ Top ]

$_format =

[line 79]

Image format



Tags:

access:  protected

Type:   string


[ Top ]

$_height =

[line 107]

Image height



Tags:

access:  protected

Type:   integer


[ Top ]

$_newResource =

[line 93]

GD new image resource



Tags:

access:  protected

Type:   resource


[ Top ]

$_options = array(
        self::OPTION_JPEG_QUALITY => 100,
        self::OPTION_PRESERVE_RATIO => true
    )

[line 62]

Options



Tags:

access:  protected

Type:   array


[ Top ]

$_ratio =

[line 114]

Image ratio



Tags:

access:  protected

Type:   integer


[ Top ]

$_resource =

[line 86]

GD image resource



Tags:

access:  protected

Type:   resource


[ Top ]

$_trueColor =  true

[line 121]

Check if true color functions are available



Tags:

access:  protected

Type:   boolean


[ Top ]

$_width =

[line 100]

Image width



Tags:

access:  protected

Type:   integer


[ Top ]



Class Methods


constructor __construct [line 131]

void __construct( string $file, [array $options = array()])

Constructor



Tags:

throws:  SimpleGallery_Exception
access:  public


Parameters:

string   $file   File for which to create thumbnail
array   $options   Options for the thumbnail creator

[ Top ]

method adaptiveResize [line 233]

void adaptiveResize( integer $maxWidth, integer $maxHeight)

Resize an image adaptively. The resulting image will have exactly the given max width and height, cropping the image in the center for it for best fit after the resize is made



Tags:

throws:  SimpleGallery_Exception
access:  public


Parameters:

integer   $maxWidth   Maximum image width
integer   $maxHeight   Maximum image height

[ Top ]

method getHeight [line 166]

integer getHeight( )

Get image height



Tags:

return:  Height value
access:  public


[ Top ]

method getWidth [line 156]

integer getWidth( )

Get image width



Tags:

return:  Width value
access:  public


[ Top ]

method resize [line 179]

void resize( integer $maxWidth, integer $maxHeight)

Resizes an image to be no larger than given values



Tags:

throws:  SimpleGallery_Exception
access:  public


Parameters:

integer   $maxWidth   Maximum image width
integer   $maxHeight   Maximum image height

[ Top ]

method save [line 297]

void save( string $destination, [string $format = null])

Save the new image



Tags:

throws:  SimpleGallery_Exception
access:  public


Parameters:

string   $destination   The destination where to save the image
string   $format   The destination file format

[ Top ]

method _calcAdaptiveImageSize [line 557]

array _calcAdaptiveImageSize( integer $maxWidth, integer $maxHeight)

Compute adaptive image size



Tags:

return:  An array width the following keys: width, height, cropWidth, cropHeight
access:  protected


Parameters:

integer   $maxWidth   Maximum width
integer   $maxHeight   Maximum height

[ Top ]

method _calcImageSize [line 487]

array _calcImageSize( integer $maxWidth, integer $maxHeight)

Compute image size



Tags:

return:  An array width the following keys: width, height
access:  protected


Parameters:

integer   $maxWidth   Maximum width
integer   $maxHeight   Maximum height

[ Top ]

method _calcImageSizeStrict [line 523]

array _calcImageSizeStrict( integer $maxWidth, integer $maxHeight)

Compute strict image size - the resulting image will have one of the dimensions the given value, the other will be larger. This function is useful for cropping.



Tags:

return:  An array width the following keys: width, height
access:  protected


Parameters:

integer   $maxWidth   Maximum width
integer   $maxHeight   Maximum height

[ Top ]

method _checkFormatSupport [line 375]

void _checkFormatSupport( )

Check if image format is supported



Tags:

throws:  SimpleGallery_Exception
access:  protected


[ Top ]

method _detectDimensions [line 446]

void _detectDimensions( )

Detect image dimensions



Tags:

access:  protected


[ Top ]

method _detectFormat [line 334]

void _detectFormat( )

Detect image format



Tags:

throws:  SimpleGallery_Exception
access:  protected


[ Top ]

method _loadImage [line 420]

void _loadImage( )

Load image to internal GD resource



Tags:

throws:  SimpleGallery_Exception
access:  protected


[ Top ]

method _setOptions [line 461]

void _setOptions( $options)

Set options



Tags:

throws:  SimpleGallery_Exception
access:  protected


Parameters:

array   $options   Options to set

[ Top ]

method _validateFormat [line 581]

void _validateFormat( string $format)

Validate format



Tags:

throws:  SimpleGallery_Exception
access:  protected


Parameters:

string   $format   Format to validate

[ Top ]


Class Constants

FORMAT_GIF =  'gif'

[line 36]

GIF file format


[ Top ]

FORMAT_JPG =  'jpg'

[line 31]

JPEG file format


[ Top ]

FORMAT_PNG =  'png'

[line 41]

PNG file format


[ Top ]

OPTION_JPEG_QUALITY =  'jpeg_quality'

[line 50]

Jpeg quality option key


[ Top ]

OPTION_PRESERVE_RATIO =  'preserve_ratio'

[line 55]

Preserve ratio option key


[ Top ]



Documentation generated on Fri, 18 Feb 2011 19:38:54 +0200 by phpDocumentor 1.4.3