GdThumb Class Definition
This is the GD Implementation of the PHP Thumb library.
Located in /legacy/GdThumb.inc.php (line 33)
ThumbBase | --GdThumb
The current dimensions of the image
The maximum height an image can be after resizing (in pixels)
The maximum width an image can be after resizing (in pixels)
The new, calculated dimensions of the image
The prior image (before manipulation)
The options for this class
This array contains various options that determine the behavior in various functions throughout the class. Functions note which specific option key / values are used in their documentation
The percentage to resize the image by
The working image (used during manipulation)
Inherited from ThumbBase
ThumbBase::$errorMessage
ThumbBase::$fileName
ThumbBase::$format
ThumbBase::$hasError
ThumbBase::$imported
ThumbBase::$importedFunctions
ThumbBase::$remoteImage
Class Constructor
Adaptively Resizes the Image
This function attempts to get the image to as close to the provided dimensions as possible, and then crops the remaining overflow (from the center) to get the image to be the size specified
Calculates a new width and height for the image based on $this->maxWidth and the provided dimensions
Calculates the new image dimensions
These calculations are based on both the provided dimensions and $this->maxWidth and $this->maxHeight
Calculates new dimensions based on $this->percent and the provided dimensions
Calculates new image dimensions, not allowing the width and height to be less than either the max width or height
Calculates a new width and height for the image based on $this->percent and the provided dimensions
Calculates a new width and height for the image based on $this->maxWidth and the provided dimensions
Vanilla Cropping - Crops from x,y with specified width and height
Crops an image from the center with provided dimensions
If no height is given, the width will be used as a height, thus creating a square crop
Determines the file format by mime-type
This function will throw exceptions for invalid images / mime-types
Preserves the alpha or transparency for PNG and GIF files
Alpha / transparency will not be preserved if the appropriate options are set to false. Also, the GIF transparency is pretty skunky (the results aren't awesome), but it works like a champ... that's the nature of GIFs tho, so no huge surprise.
This functionality was originally suggested by commenter Aimi (no links / site provided) - Thanks! :)
Resizes an image to be no larger than $maxWidth or $maxHeight
If either param is set to zero, then that dimension will not be considered as a part of the resize. Additionally, if $this->options['resizeUp'] is set to true (false by default), then this function will also scale the image up to the maximum dimensions provided.
Resizes an image by a given percent uniformly
Percentage should be whole number representation (i.e. 1-100)
Rotates image either 90 degrees clockwise or counter-clockwise
Saves an image
This function will make sure the target directory is writeable, and then save the image.
If the target directory is not writeable, the function will try to correct the permissions (if allowed, this is set as an option ($this->options['correctPermissions']). If the target cannot be made writeable, then a RuntimeException is thrown.
TODO: Create additional paramter for color matte when saving images with alpha to non-alpha formats (i.e. PNG => JPG)
Sets $currentDimensions.
Sets $newDimensions.
Sets $this->options to $options
Sets $workingImage.
Shows an image
This function will show the current image by first sending the appropriate header for the format, and then outputting the image data. If headers have already been sent, a runtime exception will be thrown
Makes sure the correct GD implementation exists for the file type
Inherited From ThumbBase
ThumbBase::__construct()
ThumbBase::fileExistsAndReadable()
ThumbBase::getErrorMessage()
ThumbBase::getFileName()
ThumbBase::getFormat()
ThumbBase::getHasError()
ThumbBase::getImported()
ThumbBase::getImportedFunctions()
ThumbBase::importPlugins()
ThumbBase::imports()
ThumbBase::setErrorMessage()
ThumbBase::setFileName()
ThumbBase::setFormat()
ThumbBase::setHasError()
ThumbBase::triggerError()
ThumbBase::__call()
Documentation generated on Tue, 09 Aug 2011 09:04:57 +0200 by phpDocumentor 1.4.3