Class ImageProcessor

Description

Class for resizing of images

  • version: $Id: ImageProcessor.class.php,v 1.8 2007/09/04 20:25:24 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/ImageProcessor/ImageProcessor.class.php (line 17)


	
			
Method Summary
obj ImageProcessor (string $thumbnailFormat, boolean $useGD, array $gdFormats, boolean $useImageMagick, string $ImageMagickPath, string $ImageMagickTempDir, array $ImageMagickFormats)
void assignConfiguration (object Properties $configuration)
void assignOsidContext (mixed $context, object OsidContext $context )
string generateThumbnailData (string $format, string $data)
object OsidContext getOsidContext ()
string getResizedData (string $format, mixed $size, string $data)
string getResizedFormat (string $format)
string getThumbnailFormat ()
string getWebsafeData (string $format, mixed $size, string $data)
string getWebsafeFormat (string $format)
boolean isFormatSupported (string $format)
Methods
Constructor ImageProcessor (line 38)

Constructor

  • since: 10/22/04
  • access: public
obj ImageProcessor (string $thumbnailFormat, boolean $useGD, array $gdFormats, boolean $useImageMagick, string $ImageMagickPath, string $ImageMagickTempDir, array $ImageMagickFormats)
  • string $thumbnailFormat: The mime type of the format you which thumbnails to be generated in. image/jpeg or image/png are recommended
  • boolean $useGD: If true, the GD image libraries will be used to generate images of the formats that they support.
  • array $gdFormats: An array of mime-types to handle with the GD libraries.
  • boolean $useImageMagick: If true, the ImageMagick application will be called via the shell to resize images that it supports.
  • string $ImageMagickPath: The path to the ImageMagick functions if ImageMagick is availible.
  • string $ImageMagickTempDir: Directory in which to place images while processing.
  • array $ImageMagickFormats: An array of mime-types to handle with ImageMagick.
assignConfiguration (line 74)

Assign the configuration of this Manager. Valid configuration options are as follows:

thumbnail_format string (ex: 'image/jpeg')

use_gd boolean gd_formats array of strings (ex: array('image/jpeg', 'image/png')) An empty array indicates any/all supported formats.

use_imagemagick boolean

imagemagick_path string (ex: 'usr/bin' OR '/usr/X11R6/bin')

imagemagick_temp_dir string (ex: '/tmp')

imagemagick_formats array of strings (ex: array('image/jpeg', 'image/png')) An empty array indicates any/all supported formats.

  • access: public
  • throws: object OsidException An exception with one of the following messages defined in org.osid.OsidException: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT
void assignConfiguration (object Properties $configuration)
  • object Properties $configuration: (original type: java.util.Properties)
assignOsidContext (line 132)

Assign the context of this OsidManager.

  • access: public
  • throws: object OsidException An exception with one of the following messages defined in org.osid.OsidException: NULL_ARGUMENT
void assignOsidContext (mixed $context, object OsidContext $context )
  • object OsidContext $context
generateThumbnailData (line 167)

Generate a thumbnail from the image format/data passed

  • return: The thumbnail data of $thumbnailFormat mime type.
  • since: 10/22/04
  • access: public
string generateThumbnailData (string $format, string $data)
  • string $format: The format of the source image
  • string $data: The data of the source image
getOsidContext (line 117)

Return context of this OsidManager.

  • access: public
  • throws: object OsidException
object OsidContext getOsidContext ()
getResizedData (line 220)

Generate a resized image from the image format/data passed

  • return: The thumbnail data of a mime type that can be obtained with getResizedFormat.
  • since: 10/22/04
  • access: public
string getResizedData (string $format, mixed $size, string $data)
  • string $format: The format of the source image
  • string $data: The data of the source image
getResizedFormat (line 198)

Get the format that a resized image will be returned in

  • return: The mime type.
  • since: 10/22/04
  • access: public
string getResizedFormat (string $format)
  • string $format: The format of the source image
getThumbnailFormat (line 186)

Return the format that thumbnails will be generated in.

  • since: 10/22/04
  • access: public
string getThumbnailFormat ()
getWebsafeData (line 262)

Generate a resized image from the image format/data passed

  • return: The thumbnail data of a mime type that can be obtained with getResizedFormat.
  • since: 10/22/04
  • access: public
string getWebsafeData (string $format, mixed $size, string $data)
  • string $format: The format of the source image
  • string $data: The data of the source image
getWebsafeFormat (line 240)

Get the format that a resized image will be returned in

  • return: The mime type.
  • since: 10/22/04
  • access: public
string getWebsafeFormat (string $format)
  • string $format: The format of the source image
isFormatSupported (line 144)

Return true if the image format is supported.

  • since: 10/22/04
  • access: public
boolean isFormatSupported (string $format)
  • string $format: The mime type of the format in question.

Documentation generated on Wed, 19 Sep 2007 10:24:38 -0400 by phpDocumentor 1.3.0RC3