Check if an image view exists and returns the vfs name complete with the hash directory name prepended if appropriate.
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
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()])
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
void
crop
( $x1, $y1, $x2, $y2)
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 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.
Sends the correct HTTP headers to the browser to download this image.
void
downloadHeaders
([string $view = 'full'])
-
string
$view: The view to download.
Flips the image.
void
flip
([string $view = 'full'])
-
string
$view: The view (size) to work with.
Update the geotag data
void
geotag
( $lat, $lng, [ $location = ''])
Returns the dimensions of the given view.
void
getDimensions
([string $view = 'full'])
-
string
$view: The view (size) to check dimensions for.
Returns this image's tags.
mixed
getTags
()
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.
Get the image type for the requested view.
void
getType
([ $view = 'full'])
Returns the file name of this image as used in the VFS backend.
string
getVFSName
( $view)
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.
Converts the image to grayscale.
void
grayscale
([string $view = 'full'])
-
string
$view: The view (size) to work with.
Loads the given view into memory.
mixed
load
([string $view = 'full'], [string $style = null])
-
string
$view: Which view to load.
-
string
$style: The named gallery style.
Mirrors the image.
void
mirror
([string $view = 'full'])
-
string
$view: The view (size) to work with.
Returns the raw data for the given view.
void
raw
([string $view = 'full'])
-
string
$view: Which view to return.
Replace this image's image data.
void
replace
( $imageData)
Reset the image, removing all loaded views.
void
reset
()
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 basic image details
void
save
()
Set/replace this image's tags.
void
setTags
(array $tags)
-
array
$tags: An array of tag names to associate with this image.
Wraps the given view into a file.
void
toFile
([string $view = 'full'])
-
string
$view: Which view to wrap up.
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.
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 based on EXIF orientation field. Updates the data in memory only.
void
_autoRotate
()
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.
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.
mixed
_getEXIF
()
Return a hash key for the given view and style.
string
_getViewHash
(string $view, [string $style = null])
-
string
$view: The view (thumb, prettythumb etc...)
-
string
$style: The named style.
Writes the current data to vfs, used when creating a new image
void
_writeData
()