Class Image
Represents an image attached to a page.
- Object
-
ViewableData
implements
IteratorAggregate
-
DataObject
implements
DataObjectInterface,
i18nEntityProvider
-
File
-
Image
Direct known subclasses
Methods summary
public
|
#
defineMethods( )
Set up template methods to access the transformations generated by 'generate' methods. |
public
boolean
|
|
public
string
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
generateSetWidth(
Resize this Image by width, keeping aspect ratio. Use in templates with $SetWidth. |
public
|
#
generateSetHeight(
Resize this Image by height, keeping aspect ratio. Use in templates with $SetHeight. |
public
|
#
generateSetSize(
Resize this Image by both width and height, using padded resize. Use in templates with $SetSize. |
public
|
|
public
|
#
generateCMSThumbnail(
Resize this image for the CMS. Use in templates with $CMSThumbnail. |
public
|
#
generateAssetLibraryPreview(
Resize this image for preview in the Asset section. Use in templates with $AssetLibraryPreview. |
public
|
#
generateAssetLibraryThumbnail(
Resize this image for thumbnail in the Asset section. Use in templates with $AssetLibraryThumbnail. |
public
|
#
generateStripThumbnail(
Resize this image for use as a thumbnail in a strip. Use in templates with $StripThumbnail. |
public
|
|
public
|
#
getFormattedImage( string $format, string $arg1 = null, string $arg2 = null )
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. |
public
string
|
#
cacheFilename( string $format, string $arg1 = null, string $arg2 = null )
Return the filename for the cached image, given it's format name and arguments. |
public
|
#
generateFormattedImage( string $format, string $arg1 = null, string $arg2 = null )
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. |
public
|
#
generateResizedImage( mixed $gd, mixed $width, mixed $height )
Generate a resized copy of this image with the given width & height. Use in templates with $ResizedImage. |
public
|
#
generateCroppedImage( mixed $gd, mixed $width, mixed $height )
Generate a resized copy of this image with the given width & height, cropping to maintain aspect ratio. Use in templates with $CroppedImage |
public
|
#
generateRotateClockwise(
Generate a rotateв Clockwise image Use in templates with $RotateClockwise |
public
|
#
generateRotateCounterClockwise(
Generate a rotateв CounterClockwise image Use in templates with $RotateCounterClockwise |
public
integer
|
|
public
string|integer
|
|
public
integer
|
|
public
integer
|
|
public
|
|
public
string
|
|
protected
|
#
onBeforeDelete( )
Event handler called before deleting from the database. You can overload this to clean up or otherwise process data before delete this record. Don't forget to call parent::onBeforeDelete(), though! |
protected
|
#
resetFilename( mixed $renamePhysicalFile = true )
Change a filename, moving the file if appropriate. |
Methods inherited from File
BackLinkTrackingCount(),
DeleteLink(),
Icon(),
Link(),
RelativeLink(),
TreeTitle(),
appCategory(),
autosetFilename(),
canCreate(),
canDelete(),
canEdit(),
canView(),
collateDescendants(),
deleteDatabaseOnly(),
fieldLabels(),
find(),
flushCache(),
format_size(),
getAbsoluteSize(),
getAbsoluteURL(),
getExtension(),
getFileType(),
getFilename(),
getFullPath(),
getLinkedURL(),
getRelativePath(),
getSize(),
getURL(),
getUsageCount(),
get_file_extension(),
instance_get(),
onAfterDelete(),
onAfterUpload(),
onBeforeWrite(),
setField(),
setFilename(),
setName(),
setParentID(),
updateLinks(),
uploadMetadataFields(),
validate()
Methods inherited from DataObject
Aggregate(),
RelationshipAggregate(),
__construct(),
baseTable(),
belongs_to(),
buildDataObjectSet(),
buildSQL(),
can(),
castedUpdate(),
composite_fields(),
context_obj(),
customDatabaseFields(),
custom_database_fields(),
data(),
databaseFields(),
databaseIndexes(),
database_extensions(),
database_fields(),
db(),
dbObject(),
debug(),
defaultSearchFilters(),
delete(),
delete_by_id(),
destroy(),
disableCMSFieldsExtensions(),
disable_subclass_access(),
duplicate(),
enableCMSFieldsExtensions(),
enable_subclass_access(),
extendedSQL(),
fieldLabel(),
flush_and_destroy_cache(),
forceChange(),
get(),
getAllFields(),
getCMSActions(),
getCMSFields(),
getChangedFields(),
getClassAncestry(),
getComponent(),
getComponents(),
getComponentsQuery(),
getDefaultSearchContext(),
getField(),
getFrontEndFields(),
getManyManyComponents(),
getManyManyComponentsQuery(),
getManyManyFilter(),
getManyManyJoin(),
getRemoteJoinField(),
getReverseAssociation(),
getTitle(),
get_by_id(),
get_one(),
get_validation_enabled(),
hasDatabaseField(),
hasField(),
hasOwnTableDatabaseField(),
hasValue(),
has_many(),
has_one(),
has_own_table(),
i18n_plural_name(),
i18n_singular_name(),
inheritedDatabaseFields(),
instance_get_one(),
isChanged(),
isEmpty(),
isInDB(),
is_composite_field(),
many_many(),
many_many_extraFields(),
merge(),
newClassInstance(),
onAfterWrite(),
plural_name(),
populateDefaults(),
provideI18nEntities(),
relObject(),
requireDefaultRecords(),
requireTable(),
reset(),
scaffoldFormFields(),
scaffoldSearchFields(),
searchableFields(),
setCastedField(),
setClassName(),
setComponent(),
set_context_obj(),
set_validation_enabled(),
singular_name(),
summaryFields(),
toMap(),
update(),
write(),
writeComponents(),
writeWithoutVersion()
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
Top(),
TotalItems(),
XML_val(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
escapeTypeForField(),
getIterator(),
getSecurityID(),
getXMLValues(),
i18nLocale(),
iteratorProperties(),
obj(),
renderWith(),
setCustomisedObj()
Methods inherited from Object
__call(),
__toString(),
__wakeup(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
create(),
createMethod(),
create_from_string(),
extInstance(),
extend(),
getCustomClass(),
getExtensionInstance(),
getExtensionInstances(),
get_extensions(),
get_static(),
hasExtension(),
hasMethod(),
has_extension(),
invokeWithExtensions(),
is_a(),
loadCache(),
parentClass(),
parse_class_spec(),
remove_extension(),
sanitiseCachename(),
saveCache(),
set_stat(),
set_static(),
set_uninherited(),
stat(),
strong_create(),
uninherited(),
uninherited_static(),
useCustomClass()
Magic methods summary
Constants summary
integer |
ORIENTATION_SQUARE
|
0 |
|
integer |
ORIENTATION_PORTRAIT
|
1 |
|
integer |
ORIENTATION_LANDSCAPE
|
2 |
Properties summary
public static
array
|
$casting |
#
Use a casting object for a field. This is a map from field name to class name of the casting object. |
public static
array
|
$safeGenerateFormats | |
public static
integer
|
$strip_thumbnail_width |
#
The width of an image thumbnail in a strip. |
public static
integer
|
$strip_thumbnail_height |
#
The height of an image thumbnail in a strip. |
public static
integer
|
$cms_thumbnail_width |
#
The width of an image thumbnail in the CMS. |
public static
integer
|
$cms_thumbnail_height |
#
The height of an image thumbnail in the CMS. |
public static
integer
|
$asset_thumbnail_width |
#
The width of an image thumbnail in the Asset section. |
public static
integer
|
$asset_thumbnail_height |
#
The height of an image thumbnail in the Asset section. |
public static
integer
|
$asset_preview_width |
#
The width of an image preview in the Asset section. |
public static
integer
|
$asset_preview_height |
#
The height of an image preview in the Asset section. |
Properties inherited from File
$allowed_extensions,
$apply_restrictions_to_admin,
$belongs_many_many,
$cache_file_fields,
$db,
$default_sort,
$defaults,
$extensions,
$has_many,
$has_one,
$indexes,
$many_many,
$plural_name,
$singular_name
Properties inherited from DataObject
$allowed_actions,
$ancestry,
$api_access,
$belongs_to,
$brokenOnDelete,
$brokenOnWrite,
$cache_get_one,
$cache_has_own_table,
$cache_has_own_table_field,
$componentCache,
$components,
$create_table_options,
$default_records,
$destroyed,
$field_labels,
$many_many_extraFields,
$original,
$record,
$searchable_fields,
$summary_fields
Properties inherited from ViewableData
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems