Class JImage

Description

Class to manipulate an image.

  • since: 11.3

Located in /libraries/joomla/image/image.php (line 19)


	
			
Class Constant Summary
Variable Summary
static array $formats
resource $handle
string $path
Method Summary
static object getImageFileProperties (string $path)
JImage __construct ([mixed $source = null])
JImage crop (mixed $width, mixed $height, integer $left, integer $top, [bool $createNew = true])
JImage filter (string $type, [array $options = array()])
integer getHeight ()
string getPath ()
integer getWidth ()
bool isLoaded ()
bool isTransparent ()
void loadFile (string $path)
object prepareDimensions (integer $width, integer $height, integer $scaleMethod)
JImage resize (mixed $width, mixed $height, [bool $createNew = true], [integer $scaleMethod = self::SCALE_INSIDE])
JImage rotate (mixed $angle, [integer $background = -1], [bool $createNew = true])
integer sanitizeHeight (mixed $height, mixed $width)
integer sanitizeOffset (mixed $offset)
integer sanitizeWidth (mixed $width, mixed $height)
void toFile (string $path, [integer $type = IMAGETYPE_JPEG], [array $options = array()])
Variables
static array $formats = array() (line 55)
  • var: Whether or not different image formats are supported.
  • since: 11.3
  • access: protected
resource $handle (line 43)
  • var: The image resource handle.
  • since: 11.3
  • access: protected
string $path = null (line 49)
  • var: The source image path.
  • since: 11.3
  • access: protected
Methods
static method getImageFileProperties (line 111)

Method to return a properties object for an image given a filesystem path. The result object has values for image width, height, type, attributes, mime type, bits, and channels.

  • since: 11.3
  • throws: InvalidArgumentException
  • throws: RuntimeException
  • access: public
static object getImageFileProperties (string $path)
  • string $path: The filesystem path to the image for which to get properties.
Constructor __construct (line 65)

Class constructor.

  • since: 11.3
  • throws: RuntimeException
  • access: public
JImage __construct ([mixed $source = null])
  • mixed $source: Either a file path for a source image or a GD resource handler for an image.
crop (line 158)

Method to crop the current image.

  • since: 11.3
  • throws: LogicException
  • access: public
JImage crop (mixed $width, mixed $height, integer $left, integer $top, [bool $createNew = true])
  • mixed $width: The width of the image section to crop in pixels or a percentage.
  • mixed $height: The height of the image section to crop in pixels or a percentage.
  • integer $left: The number of pixels from the left to start cropping.
  • integer $top: The number of pixels from the top to start cropping.
  • bool $createNew: If true the current image will be cloned, cropped and returned; else the current image will be cropped and returned.
filter (line 234)

Method to apply a filter to the image by type. Two examples are: grayscale and sketchy.

  • see: JImageFilter
  • throws: LogicException
  • throws: RuntimeException
  • since: 11.3
  • access: public
JImage filter (string $type, [array $options = array()])
  • string $type: The name of the image filter to apply.
  • array $options: An array of options for the filter.
getFilterInstance (line 619)

Method to get an image filter instance of a specified type.

  • since: 11.3
  • throws: RuntimeException
  • access: protected
JImageFilter getFilterInstance (string $type)
  • string $type: The image filter type to get.
getHeight (line 259)

Method to get the height of the image in pixels.

  • since: 11.3
  • throws: LogicException
  • access: public
integer getHeight ()
getPath (line 296)

Method to return the path

  • since: 11.3
  • access: public
string getPath ()
getWidth (line 278)

Method to get the width of the image in pixels.

  • since: 11.3
  • throws: LogicException
  • access: public
integer getWidth ()
isLoaded (line 308)

Method to determine whether or not an image has been loaded into the object.

  • since: 11.3
  • access: public
bool isLoaded ()
isTransparent (line 327)

Method to determine whether or not the image has transparency.

  • since: 11.3
  • throws: LogicException
  • access: public
bool isTransparent ()
loadFile (line 349)

Method to load a file into the JImage object as the resource.

  • throws: InvalidArgumentException
  • throws: RuntimeException
  • since: 11.3
  • access: public
void loadFile (string $path)
  • string $path: The filesystem path to load as an image.
prepareDimensions (line 660)

Method to get the new dimensions for a resized image.

  • since: 11.3
  • throws: InvalidArgumentException
  • access: protected
object prepareDimensions (integer $width, integer $height, integer $scaleMethod)
  • integer $width: The width of the resized image in pixels.
  • integer $height: The height of the resized image in pixels.
  • integer $scaleMethod: The method to use for scaling
resize (line 456)

Method to resize the current image.

  • since: 11.3
  • throws: LogicException
  • access: public
JImage resize (mixed $width, mixed $height, [bool $createNew = true], [integer $scaleMethod = self::SCALE_INSIDE])
  • mixed $width: The width of the resized image in pixels or a percentage.
  • mixed $height: The height of the resized image in pixels or a percentage.
  • bool $createNew: If true the current image will be cloned, resized and returned; else the current image will be resized and returned.
  • integer $scaleMethod: Which method to use for scaling
rotate (line 529)

Method to rotate the current image.

  • since: 11.3
  • throws: LogicException
  • access: public
JImage rotate (mixed $angle, [integer $background = -1], [bool $createNew = true])
  • mixed $angle: The angle of rotation for the image
  • integer $background: The background color to use when areas are added due to rotation
  • bool $createNew: If true the current image will be cloned, rotated and returned; else the current image will be rotated and returned.
sanitizeHeight (line 708)

Method to sanitize a height value.

  • since: 11.3
  • access: protected
integer sanitizeHeight (mixed $height, mixed $width)
  • mixed $height: The input height value to sanitize.
  • mixed $width: The input width value for reference.
sanitizeOffset (line 736)

Method to sanitize an offset value like left or top.

  • since: 11.3
  • access: protected
integer sanitizeOffset (mixed $offset)
  • mixed $offset: An offset value.
sanitizeWidth (line 751)

Method to sanitize a width value.

  • since: 11.3
  • access: protected
integer sanitizeWidth (mixed $width, mixed $height)
  • mixed $width: The input width value to sanitize.
  • mixed $height: The input height value for reference.
toFile (line 585)

Method to write the current image out to a file.

void toFile (string $path, [integer $type = IMAGETYPE_JPEG], [array $options = array()])
  • string $path: The filesystem path to save the image.
  • integer $type: The image type to save the file as.
  • array $options: The image type options to use in saving the file.
Class Constants
SCALE_FILL = 1 (line 25)
  • since: 11.3
SCALE_INSIDE = 2 (line 31)
  • since: 11.3
SCALE_OUTSIDE = 3 (line 37)
  • since: 11.3

Documentation generated on Mon, 25 Jun 2012 13:55:39 -0500 by phpDocumentor 1.4.4