Overview

Packages

  • Ansel
  • None

Classes

  • Ansel
  • Ansel_Ajax_Application
  • Ansel_Ajax_Imple_EditCaption
  • Ansel_Ajax_Imple_EditFaces
  • Ansel_Ajax_Imple_EditGalleryFaces
  • Ansel_Ajax_Imple_Embed
  • Ansel_Ajax_Imple_GallerySlugCheck
  • Ansel_Ajax_Imple_ImageSaveGeotag
  • Ansel_Ajax_Imple_LocationAutoCompleter
  • Ansel_Ajax_Imple_MapLayerSelect
  • Ansel_Ajax_Imple_TagActions
  • Ansel_Ajax_Imple_ToggleGalleryActions
  • Ansel_Ajax_Imple_ToggleOtherGalleries
  • Ansel_Ajax_Imple_UploadNotification
  • Ansel_Api
  • Ansel_Exception
  • Ansel_Faces
  • Ansel_Faces_Base
  • Ansel_Faces_Facedetect
  • Ansel_Faces_User
  • Ansel_Factory_Faces
  • Ansel_Factory_Storage
  • Ansel_Factory_Styles
  • Ansel_Form_Ecard
  • Ansel_Form_Image
  • Ansel_Form_ImageDate
  • Ansel_Form_Upload
  • Ansel_Gallery
  • Ansel_Gallery_Decorator_Date
  • Ansel_GalleryMode_Base
  • Ansel_GalleryMode_Date
  • Ansel_GalleryMode_Normal
  • Ansel_Image
  • Ansel_ImageGenerator
  • Ansel_ImageGenerator_Mini
  • Ansel_ImageGenerator_PolaroidThumb
  • Ansel_ImageGenerator_PolaroidThumbStack
  • Ansel_ImageGenerator_RoundedThumb
  • Ansel_ImageGenerator_RoundedThumbStack
  • Ansel_ImageGenerator_Screen
  • Ansel_ImageGenerator_ShadowThumb
  • Ansel_ImageGenerator_ShadowThumbStack
  • Ansel_ImageGenerator_SquareThumb
  • Ansel_ImageGenerator_Thumb
  • Ansel_LoginTasks_SystemTask_Upgrade
  • Ansel_Report
  • Ansel_Report_letter
  • Ansel_Report_mail
  • Ansel_Report_tickets
  • Ansel_Search
  • Ansel_Search_exif
  • Ansel_Search_Tag
  • Ansel_Storage
  • Ansel_Style
  • Ansel_Tagger
  • Ansel_Test
  • Ansel_Tile_DateGallery
  • Ansel_Tile_Gallery
  • Ansel_Tile_Image
  • Ansel_View_Ansel
  • Ansel_View_Base
  • Ansel_View_EmbeddedRenderer_GalleryLink
  • Ansel_View_EmbeddedRenderer_Mini
  • Ansel_View_EmbeddedRenderer_Slideshow
  • Ansel_View_Gallery
  • Ansel_View_GalleryProperties
  • Ansel_View_GalleryRenderer_Base
  • Ansel_View_GalleryRenderer_Gallery
  • Ansel_View_GalleryRenderer_GalleryLightbox
  • Ansel_View_Image
  • Ansel_View_List
  • Ansel_View_Results
  • Ansel_View_Slideshow
  • Ansel_View_Upload
  • Ansel_Widget
  • Ansel_Widget_Actions
  • Ansel_Widget_Base
  • Ansel_Widget_GalleryFaces
  • Ansel_Widget_Geotag
  • Ansel_Widget_ImageFaces
  • Ansel_Widget_Links
  • Ansel_Widget_OtherGalleries
  • Ansel_Widget_OwnerFaces
  • Ansel_Widget_SimilarPhotos
  • Ansel_Widget_Tags
  • Ansel_XPPublisher
  • Overview
  • Package
  • Class
  • Tree

Class Ansel_Image

Class to describe a single Ansel image.

Copyright 2001-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Ansel_Image implements Iterator
Package: Ansel
Author: Chuck Hagenbuch chuck@horde.org
Author: Michael J. Rubinsky mrubinsk@horde.org
Located at Image.php
Methods summary
public Ansel_Image
# __construct( array $image = array() )

Const'r

Const'r

Parameters

$image

Returns

Ansel_Image
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

$hash
The sytle hash

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

Ansel_Exception
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

Ansel_Exception
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

Ansel_Exception
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

Ansel_Exception
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

Ansel_Exception
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

Ansel_Exception
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
# downloadHeaders( string $view = 'full' )

Sends the correct HTTP headers to the browser to download this image.

Sends the correct HTTP headers to the browser to download this image.

Parameters

$view
The view to download.
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

Ansel_Exception
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

Ansel_Exception
public
# rotate( string $view, integer $angle )

Rotates the image.

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

$x1
$y1
$x2
$y2

Throws

Ansel_Exception

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

Ansel_Exception
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

Ansel_Exception
public
# watermark( string $view = 'full', string $watermark = null, string $halign = null, string $valign = null, string $font = null )

Watermarks the image.

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

Ansel_Exception
public
# flip( string $view = 'full' )

Flips the image.

Flips the image.

Parameters

$view
The view to work with.

Throws

Ansel_Exception
public
# mirror( string $view = 'full' )

Mirrors the image.

Mirrors the image.

Parameters

$view
The view (size) to work with.

Throws

Ansel_Exception
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

Ansel_Exception
public
# applyEffects( )

Apply any pending effects to the underlaying Horde_Image

Apply any pending effects to the underlaying Horde_Image

Throws

Ansel_Exception
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

Ansel_Exception
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

Ansel_Exception
public
# rewind( )

Reset the iterator to the first image in the set.

Reset the iterator to the first image in the set.

Throws

Ansel_Exception

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

Ansel_Image

Implementation of

Iterator::current()
public integer
# key( )

Get the index of the internal iterator.

Get the index of the internal iterator.

Returns

integer

Throws

Ansel_Exception

Implementation of

Iterator::key()
public mixed
# next( )

Advance the iterator

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

Ansel_Exception

Implementation of

Iterator::valid()
Properties summary
public integer $gallery

The gallery id of this image's parent gallery

The gallery id of this image's parent gallery

#
public integer $id

Image Id

Image Id

# null
public string $filename

The filename for this image

The filename for this image

# 'Untitled'
public string $caption

Image caption

Image caption

# ''
public string $type

The image's mime type

The image's mime type

# 'image/jpeg'
public integer $uploaded

Timestamp of uploaded datetime

Timestamp of uploaded datetime

#
public integer $sort

Sort count for this image

Sort count for this image

#
public integer $commentCount

The number of comments for this image, if available.

The number of comments for this image, if available.

#
public integer $facesCount

Number of faces in this image

Number of faces in this image

#
public string $lat

Latitude

Latitude

#
public string $lng

Longitude

Longitude

#
public string $location

Textual location

Textual location

#
public integer $geotag_timestamp

Timestamp for when image was geotagged

Timestamp for when image was geotagged

#
public integer $originalDate

Timestamp of original date.

Timestamp of original date.

#
API documentation generated by ApiGen