Class TranscodingActionResizeIMG

Description

Transcoding action that resizes images that appear in the given HTML content to match the requesting device's list of supported image formats and screen size.

A few options may be set through a call to TranscodingAction::setOption() as needed:

  • mobile_device: contains the DDR property reference that the transcoding uses to tell whether the requesting device is mobile or not. The action uses the is_wireless_device property of the WURFL namespace when the option is not set.
  • image_format_support: contains the DDR property reference that the action uses to know the list of image formats supported by the requesting device. The action uses the imageFormatSupport property of the DDR Core Vocabulary when the option is not set.
  • resolution_width: contains the DDR property reference that the action uses to know the width of the screen of the requesting device. The action uses the displayWidth property of the DDR Core Vocabulary when the option is not set.
  • resolution_height: contains the DDR property reference that the action uses to know the height of the screen of the requesting device. The action uses the displayHeight property of the DDR Core Vocabulary when the option is not set.
  • purge: purge the file cache when true. False by default.
  • ratio: keep the ratio of the original image when true. True by default.
  • img_cache: File path to the folder that is to contain adapted images.
  • img_cache_uri: URI path to the cache folder.
  • uri_mappings => The list of URI mappings to use to convert an absolute HTTP URI to a local file. Mappings must be separated by a space. Each mapping consists of a root URI and a root folder separated by a '|'. Ex: http://example.com/img/|/var/www/img/
  • max_image_size: maximum image size in bytes. Images that are still bigger than this size after conversion are removed from the content.
This transcoding action does two jobs in practice:
  • it resizes and saves the images that appear in the given HTML content. Images are saved in the cache subfolder (the code must have write access to that folder!)
  • it updates the img tag definitions in the HTML content with the new src, width and height attribute values.
Image formats that are not supported by the requesting device and that cannot be converted to another format are removed.

Located in /common/transcoding/transcodingactionresizeimg.php (line 73)

TranscodingAction
   |
   --TranscodingActionResizeIMG
Method Summary
string apply ( $content, $content $evidence)
Variables
Methods
apply (line 106)

Process and adapt images that appear in the given HTML content to match the requesting device's capabilities.

  • return: The transcoded content.
  • exception: SystemException The evidence is not valid.
  • access: public
string apply ( $content, $content $evidence)
  • $content $evidence: string The HTML content to transcode.
  • $content

Redefinition of:
TranscodingAction::apply()
Applies the transcoding action to the given content, using the capabilities of the device identified by the given evidence.

Inherited Methods

Inherited From TranscodingAction

TranscodingAction::__construct()
TranscodingAction::apply()
TranscodingAction::getNextBlock()
TranscodingAction::getOption()
TranscodingAction::getPropertyValue()
TranscodingAction::getPropertyValuePr()
TranscodingAction::getRelativeUri()
TranscodingAction::initOption()
TranscodingAction::initProperty()
TranscodingAction::initPropertyValues()
TranscodingAction::mapAbsoluteUriToFile()
TranscodingAction::mapFileToAbsoluteUri()
TranscodingAction::mapFileToUri()
TranscodingAction::mapUriToFile()
TranscodingAction::resolveUri()
TranscodingAction::setOption()
TranscodingAction::unparse_url()

Documentation generated on Tue, 17 Nov 2009 19:00:41 +0100 by phpDocumentor 1.4.2