Class Ansel_Image

Description

Class to describe a single Ansel image.

Located in /lib/Ansel.php (line 1981)


	
			
Variable Summary
 mixed $caption
 mixed $facesCount
 mixed $filename
 integer $gallery
 mixed $id
 mixed $lat
 mixed $lng
 mixed $location
 integer $originalDate
 mixed $sort
 mixed $type
 integer $uploaded
 mixed $_data
 mixed $_dirty
 array $_exif
 Horde_Image $_image
 mixed $_loaded
 array $_tags
Method Summary
 static mixed viewExists (integer $id, string $view, string $style)
 Ansel_Image Ansel_Image ([unknown_type $image = array()])
 void createView (string $view, [string $style = null])
 void crop ( $x1,  $y1,  $x2,  $y2)
 void deleteCache ([string $view = 'all'])
 void display ([string $view = 'full'], [string $style = null])
 void downloadHeaders ([string $view = 'full'])
 void flip ([string $view = 'full'])
 void geotag ( $lat,  $lng, [ $location = ''])
 void getDimensions ([string $view = 'full'])
 mixed getTags ()
 void getTile ([Ansel_Gallery $parent = null], [string $style = null], [boolean $mini = false], [array $params = array()])
 void getType ([ $view = 'full'])
 string getVFSName ( $view)
 string getVFSPath ([string $view = 'full'], [string $style = null])
 void grayscale ([string $view = 'full'])
 mixed load ([string $view = 'full'], [string $style = null])
 void mirror ([string $view = 'full'])
 void raw ([string $view = 'full'])
 void replace ( $imageData)
 void reset ()
 void rotate ([string $view = 'full'], integer $angle)
 void save ()
 void setTags (array $tags)
 void toFile ([string $view = 'full'])
 void updateData (string $data, [string $view = 'full'])
 void watermark ([string $view = 'full'], [string $watermark = null], [ $halign = null], [ $valign = null], [ $font = null])
 void _autoRotate ()
 void _exifToTags ([array $fields = array()])
 mixed _getEXIF ()
 string _getViewHash (string $view, [string $style = null])
 void _writeData ()
Variables
mixed $caption = '' (line 1995)
mixed $commentCount (line 2006)
mixed $facesCount = 0 (line 2007)
mixed $filename = 'Untitled' (line 1994)
integer $gallery (line 1986)
  • var: The gallery id of this image's parent gallery
mixed $geotag_timestamp (line 2011)
mixed $id = null (line 1993)
mixed $lat (line 2008)
mixed $lng (line 2009)
mixed $location (line 2010)
integer $originalDate (line 2021)

Timestamp of original date.

mixed $sort (line 2005)
mixed $type = 'image/jpeg' (line 1996)
integer $uploaded (line 2003)

timestamp of uploaded date

mixed $_data = array() (line 2030)
mixed $_dirty (line 2013)
array $_exif = array() (line 2037)

Cache the raw EXIF data locally

Horde_Image $_image (line 1991)
  • var: Horde_Image object for this image.
mixed $_loaded = array() (line 2029)
array $_tags = array() (line 2027)

Holds an array of tags for this image

Methods
static viewExists (line 2209)

Check if an image view exists and returns the vfs name complete with the hash directory name prepended if appropriate.

  • return: False if image does not exists | string vfs name
static mixed viewExists (integer $id, string $view, string $style)
  • integer $id: Image id to check
  • string $view: Which view to check for
  • string $style: A named gallery style
Constructor Ansel_Image (line 2046)

TODO: refactor Ansel_Image to use a ::get() method like Ansel_Gallery instead of direct instance variable access and all the nonsense below.

Ansel_Image Ansel_Image ([unknown_type $image = array()])
  • unknown_type $image
createView (line 2244)

Creates and caches the given view.

void createView (string $view, [string $style = null])
  • string $view: Which view to create.
  • string $style: A named gallery style
crop (line 2794)
void crop ( $x1,  $y1,  $x2,  $y2)
  • $x1
  • $y1
  • $x2
  • $y2
deleteCache (line 2645)

Deletes the specified cache file.

If none is specified, deletes all of the cache files.

void deleteCache ([string $view = 'all'])
  • string $view: Which cache file to delete.
display (line 2724)

Display the requested view.

void display ([string $view = 'full'], [string $style = null])
  • string $view: Which view to display.
  • string $style: Force use of this gallery style.
downloadHeaders (line 2703)

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

void downloadHeaders ([string $view = 'full'])
  • string $view: The view to download.
flip (line 2866)

Flips the image.

void flip ([string $view = 'full'])
  • string $view: The view (size) to work with.
geotag (line 2365)

Update the geotag data

void geotag ( $lat,  $lng, [ $location = ''])
  • $lat
  • $lng
  • $location
getDimensions (line 2773)

Returns the dimensions of the given view.

void getDimensions ([string $view = 'full'])
  • string $view: The view (size) to check dimensions for.
getTags (line 2891)

Returns this image's tags.

mixed getTags ()
getTile (line 2947)

Get the Ansel_View_Image_Thumb object

void getTile ([Ansel_Gallery $parent = null], [string $style = null], [boolean $mini = false], [array $params = array()])
  • Ansel_Gallery $parent: The parent Ansel_Gallery object.
  • string $style: A named gallery style to use.
  • boolean $mini: Force the use of a mini thumbnail?
  • array $params: Any additional parameters the Ansel_Tile object may need.
getType (line 2964)

Get the image type for the requested view.

void getType ([ $view = 'full'])
  • $view
getVFSName (line 2121)

Returns the file name of this image as used in the VFS backend.

  • return: This image's VFS file name.
string getVFSName ( $view)
  • $view
getVFSPath (line 2108)

Return the vfs path for this image.

  • return: The vfs path for this image.
string getVFSPath ([string $view = 'full'], [string $style = null])
  • string $view: The view we want.
  • string $style: A named gallery style.
grayscale (line 2805)

Converts the image to grayscale.

void grayscale ([string $view = 'full'])
  • string $view: The view (size) to work with.
load (line 2148)

Loads the given view into memory.

  • return: True || PEAR_Error
mixed load ([string $view = 'full'], [string $style = null])
  • string $view: Which view to load.
  • string $style: The named gallery style.
mirror (line 2878)

Mirrors the image.

void mirror ([string $view = 'full'])
  • string $view: The view (size) to work with.
raw (line 2688)

Returns the raw data for the given view.

void raw ([string $view = 'full'])
  • string $view: Which view to return.
replace (line 2482)

Replace this image's image data.

void replace ( $imageData)
  • $imageData
reset (line 2632)

Reset the image, removing all loaded views.

void reset ()
rotate (line 2787)

Rotates the image.

void rotate ([string $view = 'full'], integer $angle)
  • string $view: The view (size) to work with.
  • integer $angle: What angle to rotate the image by.
save (line 2379)

Save basic image details

void save ()
setTags (line 2921)

Set/replace this image's tags.

void setTags (array $tags)
  • array $tags: An array of tag names to associate with this image.
toFile (line 2760)

Wraps the given view into a file.

void toFile ([string $view = 'full'])
  • string $view: Which view to wrap up.
updateData (line 2346)

Change the image data. Deletes old cache and writes the new data to the VFS. Used when updating an image

void updateData (string $data, [string $view = 'full'])
  • string $data: The new data for this image.
  • string $view: If specified, the $data represents only this particular view. Cache will not be deleted.
watermark (line 2818)

Watermarks the image.

void watermark ([string $view = 'full'], [string $watermark = null], [ $halign = null], [ $valign = null], [ $font = null])
  • string $view: The view (size) to work with.
  • string $watermark: String to use as the watermark.
  • $halign
  • $valign
  • $font
_autoRotate (line 2585)

Autorotate based on EXIF orientation field. Updates the data in memory only.

void _autoRotate ()
_exifToTags (line 2508)

Adds specified EXIF fields to this image's tags. Called during image upload/creation.

void _exifToTags ([array $fields = array()])
  • array $fields: An array of EXIF fields to import as a tag.
_getEXIF (line 2533)

Reads the EXIF data from the image and stores in _exif array() as well also populates any local properties that come from the EXIF data.

  • return: true if any local properties were modified, false otherwise, PEAR_Error on failure
mixed _getEXIF ()
_getViewHash (line 2983)

Return a hash key for the given view and style.

  • return: A md5 hash suitable for use as a key.
string _getViewHash (string $view, [string $style = null])
  • string $view: The view (thumb, prettythumb etc...)
  • string $style: The named style.
_writeData (line 2330)

Writes the current data to vfs, used when creating a new image

void _writeData ()

Documentation generated on Sun, 30 Jan 2011 05:08:43 +0000 by phpDocumentor 1.4.3