Methods summary
public
Ansel_Image
|
#
__construct( array $image = array() )
Const'r
Parameters
Returns
|
public
Horde_Image_Base
&
|
#
getHordeImage( )
Obtain a reference to the underlying Horde_Image
Obtain a reference to the underlying Horde_Image
Returns
Horde_Image_Base
|
public
string
|
#
getVFSPath( string $view = 'full', Ansel_Style $style = null )
Return the vfs path for this image.
Return the vfs path for this image.
Parameters
- $view
- The view we want.
- $style
- A gallery style.
Returns
string The vfs path for this image.
|
public
string
|
#
getVFSPathFromHash( string $hash )
Generate a path on the VFS given a known style hash.
Generate a path on the VFS given a known style hash.
Parameters
Returns
string the VFS path to the directory for the provided hash
|
public
string
|
#
getVFSName( string $view )
Returns the file name of this image as used in the VFS backend.
Returns the file name of this image as used in the VFS backend.
Parameters
- $view
- The image view (full, screen, thumb, mini).
Returns
string This image's VFS file name.
|
public
|
#
load( string $view = 'full', Ansel_Style $style = null )
Loads the given view into memory.
Loads the given view into memory.
Parameters
- $view
- Which view to load.
- $style
- The gallery style.
Throws
|
public static
mixed
|
#
viewExists( integer $id, string $view, Ansel_Style $style )
Check if an image view exists and returns the vfs name complete with
the hash directory name prepended if appropriate.
Check if an image view exists and returns the vfs name complete with
the hash directory name prepended if appropriate.
Parameters
- $id
- Image id to check
- $view
- Which view to check for
- $style
- Style object
Returns
mixed False if image does not exists | string vfs name
|
public
|
#
createView( string $view, Ansel_Style $style = null )
Creates and caches the given view.
Creates and caches the given view.
Parameters
- $view
- Which view to create.
- $style
- A style object
Throws
|
public
|
#
updateData( string $data, string $view = 'full' )
Change the image data. Deletes old cache and writes the new
data to the VFS. Used when updating an image
Change the image data. Deletes old cache and writes the new
data to the VFS. Used when updating an image
Parameters
- $data
- The new data for this image.
- $view
- <p>If specified, the $data represents only this
particular view. Cache will not be deleted.</p>
Throws
|
public
|
#
geotag( string $lat, string $lng, string $location = '' )
Update the image's geotag data. Saves to backend storage as well, so no
need to call self::save()
Update the image's geotag data. Saves to backend storage as well, so no
need to call self::save()
Parameters
- $lat
- Latitude
- $lng
- Longitude
- $location
- Textual location
|
public
integer
|
#
save( )
Save image details to storage.
Save image details to storage.
Returns
integer image id
Throws
|
public
|
#
replace( array $imageData )
Replace this image's image data.
Replace this image's image data.
Parameters
- $imageData
- An array of image data, the same keys as Const'r
Throws
|
public
boolean
|
#
getEXIF( boolean $replacing = false )
Reads the EXIF data from the image, caches in the object and writes to
storage. Also populates any local properties that come from the EXIF
data.
Reads the EXIF data from the image, caches in the object and writes to
storage. Also populates any local properties that come from the EXIF
data.
Parameters
- $replacing
- Set to true if we are replacing the exif data.
Returns
boolean True if any local properties were modified, False if not.
Throws
|
public
|
#
reset( )
Reset the image, removing all loaded views.
Reset the image, removing all loaded views.
|
public
|
#
deleteCache( string $view = 'all' )
Deletes the specified cache file.
Deletes the specified cache file.
If none is specified, deletes all of the cache files.
Parameters
- $view
- Which cache file to delete.
|
public
string
|
#
raw( string $view = 'full' )
Returns the raw data for the given view.
Returns the raw data for the given view.
Parameters
- $view
- Which view to return.
Returns
string The raw binary image data
|
public
|
#
display( string $view = 'full', Ansel_Style $style = null )
Display the requested view.
Display the requested view.
Parameters
- $view
- Which view to display.
- $style
- Force use of this gallery style.
Throws
Horde_Exception_PermissionDenied, Ansel_Exception
|
public
|
#
toFile( string $view = 'full' )
Wraps the given view into a file.
Wraps the given view into a file.
Parameters
- $view
- Which view to wrap up.
Throws
|
public
array
|
#
getDimensions( string $view = 'full' )
Returns the dimensions of the given view.
Returns the dimensions of the given view.
Parameters
- $view
- The view (full, screen etc..) to get dimensions for
Returns
array A hash of 'width and 'height' dimensions.
Throws
|
public
|
#
rotate( string $view, integer $angle )
Rotates the image.
Parameters
- $view
- The view (size) to work with.
- $angle
- What angle to rotate the image by.
|
public
|
#
crop( integer $x1, integer $y1, integer $x2, integer $y2 )
Crop this image to desired dimensions. Crops the currently loaded
view present in the Horde_Image object.
Crop this image to desired dimensions. Crops the currently loaded
view present in the Horde_Image object.
Parameters
Throws
See
Horde_Image_Base::crop for explanation of parameters
|
public
|
#
resize( integer $width, integer $height, boolean $ratio = true, boolean $keepProfile = false )
Resize the current image.
Resize the current image.
Parameters
- $width
- The new width.
- $height
- The new height.
- $ratio
- Maintain original aspect ratio.
- $keepProfile
- Keep the image meta data.
Throws
|
public
|
#
grayscale( string $view = 'full' )
Converts the image to grayscale.
Converts the image to grayscale.
Parameters
- $view
- The view (screen, full, etc...) to work with.
Throws
|
public
|
#
watermark( string $view = 'full', string $watermark = null, string $halign = null, string $valign = null, string $font = null )
Watermarks the image.
Parameters
- $view
- The view (size) to work with.
- $watermark
- String to use as the watermark.
- $halign
- Horizontal alignment (Left, Right, Center)
- $valign
- Vertical alignment (Top, Center, Bottom)
- $font
- <p>The font to use (not all image drivers will
support this).</p>
Throws
|
public
|
#
flip( string $view = 'full' )
Flips the image.
Parameters
- $view
- The view to work with.
Throws
|
public
|
#
mirror( string $view = 'full' )
Mirrors the image.
Parameters
- $view
- The view (size) to work with.
Throws
|
public
|
#
addEffect( string $type, array $params = array() )
Add an effect to the effect stack
Add an effect to the effect stack
Parameters
- $type
- The effect to add.
- $params
- The effect parameters.
Throws
|
public
|
#
applyEffects( )
Apply any pending effects to the underlaying Horde_Image
Apply any pending effects to the underlaying Horde_Image
Throws
|
public
array
|
#
getTags( )
Returns this image's tags.
Returns this image's tags.
Returns
array An array of tags
Throws
Horde_Exception_PermissionDenied, Ansel_Exception
See
Ansel_Tags::readTags()
|
public
|
#
setTags( array $tags, boolean $replace = true )
Either add or replace this image's tags.
Either add or replace this image's tags.
Parameters
- $tags
- An array of tag names
- $replace
- Replace all tags with those provided.
Throws
Horde_Exception_PermissionDenied
|
public
|
#
removeTag( string $tag )
Remove a single tag from this image's tag collection
Remove a single tag from this image's tag collection
Parameters
- $tag
- The tag name to remove.
|
public
string
|
#
getTile( Ansel_Gallery $parent = null, Ansel_Style $style = null, boolean $mini = false, array $params = array() )
Get the Ansel_View_Image_Thumb object
Get the Ansel_View_Image_Thumb object
Parameters
- $parent
- The parent Ansel_Gallery object.
- $style
- A gallery definition to use.
- $mini
- Force the use of a mini thumbnail?
- $params
- <p>Any additional parameters the Ansel_Tile
object may need.</p>
Returns
string HTML for this image's view tile.
|
public
string
|
#
getType( mixed $view = 'full' )
Get the image type for the requested view.
Get the image type for the requested view.
Returns
string The requested view's mime type
|
public
string
|
#
getViewHash( string $view, Ansel_Style $style = null )
Return a hash key for the given view and style.
Return a hash key for the given view and style.
Parameters
- $view
- The view (thumb, prettythumb etc...)
- $style
- The style.
Returns
string A md5 hash suitable for use as a key.
|
public
array
|
#
getAttributes( boolean $format = false )
Get the image attributes from the backend.
Get the image attributes from the backend.
Parameters
- $format
- <p>Format the EXIF data. If false, the raw data
is returned.</p>
Returns
array The EXIF data.
|
public
boolean
|
#
isMultiPage( )
Indicates if this image represents a multipage image.
Indicates if this image represents a multipage image.
Returns
boolean
Throws
|
public
integer
|
#
getImagePageCount( )
Get the number of pages that a multipage image contains.
Get the number of pages that a multipage image contains.
Returns
integer The number of pages.
Throws
|
public
|
#
rewind( )
Reset the iterator to the first image in the set.
Reset the iterator to the first image in the set.
Throws
Implementation of
Iterator::rewind()
|
public
Ansel_Image
|
#
current( )
Return the current image from the internal iterator.
Return the current image from the internal iterator.
Returns
Implementation of
Iterator::current()
|
public
integer
|
#
key( )
Get the index of the internal iterator.
Get the index of the internal iterator.
Returns
integer
Throws
Implementation of
Iterator::key()
|
public
mixed
|
#
next( )
Advance the iterator
Returns
mixed Ansel_Image or false if not valid()
Implementation of
Iterator::next()
|
public
boolean
|
#
valid( )
Deterimines if the current iterator item is valid.
Deterimines if the current iterator item is valid.
Returns
boolean
Throws
Implementation of
Iterator::valid()
|