Comments: on this page. Click to read or post your own.

Class Image

Description

Represents an image attached to a page.

Located in /sapphire/core/model/Image.php (line 7)

Object
   |
   --ViewableData
      |
      --DataObject
         |
         --File
            |
            --Image
Direct descendents
Class Description
Image_Cached A resized / processed Image object.
Product_Image Class to support product images
Variable Summary
static mixed $asset_preview_height
static mixed $asset_preview_width
static mixed $asset_thumbnail_width
static mixed $casting
static mixed $cms_thumbnail_height
Method Summary
string cacheFilename (string $format, [string $arg1 = null], [string $arg2 = null])
void CMSThumbnail ()
void defineMethods ()
boolean exists ()
string forTemplate ()
void generateCroppedImage ( $gd,  $width,  $height)
void generateFormattedImage (string $format, [string $arg1 = null], [string $arg2 = null])
void generatePaddedImage (GD $gd,  $width,  $height)
void generateResizedImage ( $gd,  $width,  $height)
GD generateSetHeight (GD $gd,  $height)
GD generateSetSize (GD $gd,  $width,  $height)
GD generateSetWidth (GD $gd,  $width)
string|int getDimensions ([string $dim = "string"])
Image_Cached getFormattedImage (string $format, [string $arg1 = null], [string $arg2 = null])
int getHeight ()
string getTag ()
string getURL ()
int getWidth ()
boolean loadUploaded (array $tmpFile)
void loadUploadedImage ( $tmpFile)
void SetHeight ( $height)
void SetSize ( $width,  $height)
void SetWidth ( $width)
void Tag ()
void URL ()
Variables
static mixed $asset_preview_height = 200 (line 54)

The height of an image preview in the Asset section.

  • access: public
static mixed $asset_preview_width = 400 (line 49)

The width of an image preview in the Asset section.

  • access: public
static mixed $asset_thumbnail_height = 100 (line 44)

The height of an image thumbnail in the Asset section.

  • access: public
static mixed $asset_thumbnail_width = 100 (line 39)

The width of an image thumbnail in the Asset section.

  • access: public
static mixed $casting = array(
'Tag' => 'HTMLText',
)
(line 9)

Redefinition of:
DataObject::$casting
Use a casting object for a field. This is a map from field name to class name of the casting object.
static mixed $cms_thumbnail_height = 100 (line 34)

The height of an image thumbnail in the CMS.

  • access: public
static int $cms_thumbnail_width = 100 (line 29)

The width of an image thumbnail in the CMS.

  • access: public
static int $strip_thumbnail_height = 50 (line 23)

The height of an image thumbnail in a strip.

  • access: public
static int $strip_thumbnail_width = 50 (line 17)

The width of an image thumbnail in a strip.

  • access: public

Inherited Variables

Inherited from File

File::$belongs_many_many
File::$cache_file_fields
File::$db
File::$default_sort
File::$extensions
File::$has_one
File::$indexes
File::$plural_name
File::$singular_name

Inherited from DataObject

DataObject::$ancestry
DataObject::$api_access
DataObject::$brokenOnDelete
DataObject::$brokenOnWrite
DataObject::$cache_get_one
DataObject::$changed
DataObject::$componentCache
DataObject::$components
DataObject::$defaults
DataObject::$default_records
DataObject::$destroyed
DataObject::$field_labels
DataObject::$has_many
DataObject::$many_many
DataObject::$many_many_extraFields
DataObject::$original
DataObject::$record
DataObject::$searchable_fields
DataObject::$summary_fields

Inherited from ViewableData

ViewableData::$castingHelperPair_cache
ViewableData::$customisedObj
ViewableData::$failover
ViewableData::$iteratorPos
ViewableData::$iteratorTotalItems
ViewableData::$namedAs
ViewableData::$parent
ViewableData::$_natural_cache
ViewableData::$_object_cache
ViewableData::$_xml_cache

Inherited from Object

Object::$builtInMethods
Object::$class
Object::$classConstructed
Object::$extension_instances
Object::$extraMethods
Object::$extraStatics
Object::$statics
Object::$static_cached
Methods
cacheFilename (line 273)

Return the filename for the cached image, given it's format name and arguments.

string cacheFilename (string $format, [string $arg1 = null], [string $arg2 = null])
  • string $format: The format name.
  • string $arg1: The first argument passed to the generate function.
  • string $arg2: The second argument passed to the generate function.
CMSThumbnail (line 205)
  • access: public
void CMSThumbnail ()

Redefinition of:
File::CMSThumbnail()
defineMethods (line 59)

Set up template methods to access the transformations generated by 'generate' methods.

  • access: public
void defineMethods ()

Redefinition of:
DataObject::defineMethods()
Adds methods from the extensions.
deleteFormattedImages (line 333)

Remove all of the formatted cached images.

Should be called by any method that updates the current image.

  • access: public
void deleteFormattedImages ()
exists (line 74)

An image exists if it has a filename.

  • access: public
boolean exists ()

Redefinition of:
DataObject::exists()
Returns true if this object "exists", i.e., has a sensible value.
forTemplate (line 108)

Return an XHTML img tag for this Image.

string forTemplate ()
generateAssetLibraryPreview (line 221)

Resize this image for preview in the Asset section. Use in templates with $AssetLibraryPreview.

GD generateAssetLibraryPreview (GD $gd)
generateAssetLibraryThumbnail (line 229)

Resize this image for thumbnail in the Asset section. Use in templates with $AssetLibraryThumbnail.

GD generateAssetLibraryThumbnail (GD $gd)
generateCMSThumbnail (line 213)

Resize this image for the CMS. Use in templates with $CMSThumbnail.

GD generateCMSThumbnail (GD $gd)
generateCroppedImage (line 325)

Generate a resized copy of this image with the given width & height, cropping to maintain aspect ratio.

Use in templates with $CroppedImage

void generateCroppedImage ( $gd,  $width,  $height)
  • $gd
  • $width
  • $height
generateFormattedImage (line 289)

Generate an image on the specified format. It will save the image at the location specified by cacheFilename(). The image will be generated using the specific 'generate' method for the specified format.

void generateFormattedImage (string $format, [string $arg1 = null], [string $arg2 = null])
  • string $format: Name of the format to generate.
  • string $arg1: Argument to pass to the generate method.
  • string $arg2: A second argument to pass to the generate method.
generatePaddedImage (line 241)
void generatePaddedImage (GD $gd,  $width,  $height)
  • GD $gd
  • $width
  • $height
generateResizedImage (line 313)

Generate a resized copy of this image with the given width & height.

Use in templates with $ResizedImage.

void generateResizedImage ( $gd,  $width,  $height)
  • $gd
  • $width
  • $height
generateSetHeight (line 193)

Resize this Image by height, keeping aspect ratio. Use in templates with $SetHeight.

  • access: public
GD generateSetHeight (GD $gd,  $height)
  • GD $gd
  • $height
generateSetSize (line 201)

Resize this Image by both width and height, using padded resize. Use in templates with $SetSize.

  • access: public
GD generateSetSize (GD $gd,  $width,  $height)
  • GD $gd
  • $width
  • $height
generateSetWidth (line 185)

Resize this Image by width, keeping aspect ratio. Use in templates with $SetWidth.

  • access: public
GD generateSetWidth (GD $gd,  $width)
  • GD $gd
  • $width
generateStripThumbnail (line 237)

Resize this image for use as a thumbnail in a strip. Use in templates with $StripThumbnail.

GD generateStripThumbnail (GD $gd)
getDimensions (line 358)

Get the dimensions of this Image.

string|int getDimensions ([string $dim = "string"])
  • string $dim: If this is equal to "string", return the dimensions in string form, if it is 0 return the height, if it is 1 return the width.
getFormattedImage (line 254)

Return an image object representing the image in the given format.

This image will be generated using generateFormattedImage(). The generated image is cached, to flush the cache append ?flush=1 to your URL.

Image_Cached getFormattedImage (string $format, [string $arg1 = null], [string $arg2 = null])
  • string $format: The name of the format.
  • string $arg1: An argument to pass to the generate function.
  • string $arg2: A second argument to pass to the generate function.
getHeight (line 382)

Get the height of this image.

int getHeight ()
getTag (line 96)

Return an XHTML img tag for this Image.

string getTag ()
getURL (line 88)

Get the relative URL for this Image.

Overwrites File->URL() which returns an absolute URL.

string getURL ()

Redefinition of:
File::getURL()
Gets the absolute URL accessible through the web.
getWidth (line 374)

Get the width of this image.

int getWidth ()
loadUploaded (line 117)

Load a recently uploaded image into this image field.

  • return: Returns true if successful
boolean loadUploaded (array $tmpFile)
  • array $tmpFile: The array entry from $_FILES

Redefinition of:
File::loadUploaded()
Save an file passed from a form post into this object.
loadUploadedImage (line 124)
void loadUploadedImage ( $tmpFile)
  • $tmpFile
SetHeight (line 173)
  • access: public
void SetHeight ( $height)
  • $height
SetSize (line 177)
  • access: public
void SetSize ( $width,  $height)
  • $width
  • $height
SetWidth (line 169)
  • access: public
void SetWidth ( $width)
  • $width
Tag (line 396)
  • deprecated: Use getTag() instead
void Tag ()
URL (line 403)
  • deprecated: Use getURL() instead
void URL ()

Inherited Methods

Inherited From File

File::appCategory()
File::autosetFilename()
File::CMSThumbnail()
File::collateDescendants()
File::deleteDatabaseOnly()
File::DeleteLink()
File::find()
File::flushCache()
File::format_size()
File::getAbsoluteSize()
File::getAbsoluteURL()
File::getExtension()
File::getFilename()
File::getFileType()
File::getFullPath()
File::getLinkedURL()
File::getRelativePath()
File::getSize()
File::getURL()
File::get_file_extension()
File::Icon()
File::instance_get()
File::Link()
File::loadUploaded()
File::onBeforeDelete()
File::onBeforeWrite()
File::RelativeLink()
File::resetFilename()
File::setField()
File::setFilename()
File::setName()
File::setParentID()
File::TreeTitle()
File::updateLinks()
File::userCanEdit()

Inherited From DataObject

DataObject::__construct()
DataObject::baseTable()
DataObject::buildDataObjectSet()
DataObject::buildSQL()
DataObject::can()
DataObject::canCreate()
DataObject::canDelete()
DataObject::canEdit()
DataObject::canView()
DataObject::castedUpdate()
DataObject::context_obj()
DataObject::createComponent()
DataObject::customDatabaseFields()
DataObject::data()
DataObject::databaseFields()
DataObject::databaseIndexes()
DataObject::db()
DataObject::dbObject()
DataObject::debug()
DataObject::defaultSearchFilters()
DataObject::defineMethods()
DataObject::delete()
DataObject::delete_by_id()
DataObject::destroy()
DataObject::disable_subclass_access()
DataObject::duplicate()
DataObject::enable_subclass_access()
DataObject::exists()
DataObject::extendedSQL()
DataObject::fieldExists()
DataObject::fieldLabel()
DataObject::fieldLabels()
DataObject::filledOut()
DataObject::flushCache()
DataObject::forceChange()
DataObject::get()
DataObject::getAllFields()
DataObject::getChangedFields()
DataObject::getClassAncestry()
DataObject::getCMSFields()
DataObject::getComponent()
DataObject::getComponentJoinField()
DataObject::getComponents()
DataObject::getComponentsQuery()
DataObject::getDefaultSearchContext()
DataObject::getField()
DataObject::getFrontEndFields()
DataObject::getManyManyComponents()
DataObject::getManyManyComponentsQuery()
DataObject::getManyManyFilter()
DataObject::getManyManyJoin()
DataObject::getReverseAssociation()
DataObject::getTitle()
DataObject::get_by_id()
DataObject::get_by_url()
DataObject::get_one()
DataObject::hasDatabaseField()
DataObject::hasField()
DataObject::hasOwnTableDatabaseField()
DataObject::has_many()
DataObject::has_one()
DataObject::i18n_plural_name()
DataObject::i18n_singular_name()
DataObject::inheritedDatabaseFields()
DataObject::instance_get()
DataObject::instance_get_one()
DataObject::isEmpty()
DataObject::isInDB()
DataObject::listOfFields()
DataObject::many_many()
DataObject::merge()
DataObject::newClassInstance()
DataObject::onAfterWrite()
DataObject::onBeforeDelete()
DataObject::onBeforeWrite()
DataObject::plural_name()
DataObject::populateDefaults()
DataObject::relObject()
DataObject::requireDefaultRecords()
DataObject::requireTable()
DataObject::scaffoldFormFields()
DataObject::scaffoldSearchFields()
DataObject::searchableFields()
DataObject::setCastedField()
DataObject::setClassName()
DataObject::setComponent()
DataObject::setField()
DataObject::set_context_obj()
DataObject::singular_name()
DataObject::summaryFields()
DataObject::toMap()
DataObject::update()
DataObject::validate()
DataObject::write()
DataObject::writeComponents()
DataObject::writeWithoutVersion()

Inherited From ViewableData

ViewableData::ATT_val()
ViewableData::BaseHref()
ViewableData::buildCastingHelperCache()
ViewableData::cachedCall()
ViewableData::castingHelper()
ViewableData::castingHelperPair()
ViewableData::castingObjectCreator()
ViewableData::castingObjectCreatorPair()
ViewableData::CSSClasses()
ViewableData::CurrentMember()
ViewableData::CurrentPage()
ViewableData::customise()
ViewableData::Debug()
ViewableData::defineMethods()
ViewableData::escapeTypeForField()
ViewableData::Even()
ViewableData::EvenOdd()
ViewableData::First()
ViewableData::FirstLast()
ViewableData::getField()
ViewableData::getIterator()
ViewableData::getXMLValues()
ViewableData::hasField()
ViewableData::HasPerm()
ViewableData::hasValue()
ViewableData::i18nLocale()
ViewableData::IsAjax()
ViewableData::iteratorProperties()
ViewableData::JS_val()
ViewableData::Last()
ViewableData::Me()
ViewableData::Middle()
ViewableData::MiddleString()
ViewableData::obj()
ViewableData::Odd()
ViewableData::Pos()
ViewableData::RAW_val()
ViewableData::renderWith()
ViewableData::SecurityID()
ViewableData::setCustomisedObj()
ViewableData::setField()
ViewableData::SQL_val()
ViewableData::ThemeDir()
ViewableData::Top()
ViewableData::TotalItems()
ViewableData::val()
ViewableData::XML_val()
ViewableData::__get()
ViewableData::__isset()
ViewableData::__set()

Inherited From Object

Object::__construct()
Object::addMethodsFrom()
Object::addStaticVars()
Object::addWrapperMethod()
Object::add_extension()
Object::allMethodNames()
Object::buildMethodList()
Object::cacheToFile()
Object::cacheToFileWithArgs()
Object::create()
Object::createMethod()
Object::defineMethods()
Object::exists()
Object::extend()
Object::extInstance()
Object::getCustomClass()
Object::hasExtension()
Object::hasMethod()
Object::invokeWithExtensions()
Object::is_a()
Object::loadCache()
Object::parentClass()
Object::sanitiseCachename()
Object::saveCache()
Object::set_stat()
Object::set_uninherited()
Object::stat()
Object::strong_create()
Object::uninherited()
Object::useCustomClass()
Object::__call()
Object::__toString()
blog comments powered by Disqus

Documentation generated on Sun, 19 Oct 2008 06:42:17 +1300 by phpDocumentor 1.3.2