Image _Image(
object
&$album, sting
$filename
)
|
|
Constructor for class-image
Do not call this constructor directly unless you really know what you are doing! Use instead the function newImage() which will instantiate an object of the correct class for the file type.
Parameters:
|
object |
&$album: |
the owning album |
|
sting |
$filename: |
the filename of the image |
object addComment(
string
$name, string
$email, string
$website, string
$comment, string
$code, string
$code_ok, string
$ip, bool
$private, bool
$anon
)
|
|
Adds a comment to the image assumes data is coming straight from GET or POST
Returns a comment object
Parameters:
|
string |
$name: |
Comment author name |
|
string |
$email: |
Comment author email |
|
string |
$website: |
Comment author website |
|
string |
$comment: |
body of the comment |
|
string |
$code: |
CAPTCHA code entered |
|
string |
$code_ok: |
CAPTCHA md5 expected |
|
string |
$ip: |
the IP address of the comment poster |
|
bool |
$private: |
set to true if the comment is for the admin only |
|
bool |
$anon: |
set to true if the poster wishes to remain anonymous |
bool classSetup(
&$album, string
$filename, object
$album
)
|
|
generic "image" class setup code Returns true if valid image.
Parameters:
|
object |
$album: |
the images' album |
|
string |
$filename: |
of the image |
|
|
&$album: |
|
void copyImage(
string
$newalbum
)
|
|
Copies the image to a new album, along with all metadata.
Parameters:
|
string |
$newalbum: |
the destination album |
bool deleteImage(
[bool
$clean = true]
)
|
|
Permanently delete this image (permanent: be careful!)
Returns the result of the unlink operation (whether the delete was successful)
Parameters:
|
bool |
$clean: |
whether to remove the database entry. |
Returns true if the file has changed since last time we looked
Returns the album that holds this image
Retuns the folder name of the album that holds this image
Returns the city field of the image
Returns the count of comments for the image. Comments in moderation are not counted
array getComments(
[bool
$moderated = false], [bool
$private = false], [bool
$desc = false]
)
|
|
Returns an array of comments
Parameters:
|
bool |
$moderated: |
if false, comments in moderation are ignored |
|
bool |
$private: |
if false ignores private comments |
|
bool |
$desc: |
set to true for descending order |
bool getCommentsAllowed(
)
|
|
Retuns true if comments are allowed on the image
Returns the copyright field of the image
Returns the country field of the image
Returns the credit field of the image
returns the custom data field
string getCustomImage(
int
$size, int
$width, int
$height, int
$cropw, int
$croph, int
$cropx, int
$cropy, [bool
$thumbStandin = false], [bool
$gray = false], string
$alt, string
$class, string
$id
)
|
|
Get a custom sized version of this image based on the parameters.
Parameters:
|
string |
$alt: |
Alt text for the url |
|
int |
$size: |
size |
|
int |
$width: |
width |
|
int |
$height: |
height |
|
int |
$cropw: |
crop width |
|
int |
$croph: |
crop height |
|
int |
$cropx: |
crop x axis |
|
int |
$cropy: |
crop y axis |
|
string |
$class: |
Optional style class |
|
string |
$id: |
Optional style id |
|
bool |
$thumbStandin: |
set true to inhibit watermarking |
|
bool |
$gray: |
set true to force gray scale |
Redefined in descendants as:
Returns the unformatted date of the image
Returns the description of the image
Returns the image filename
Returns a path to the original image in the original folder.
Returns the height of the image
string getImageFootprint(
)
|
|
Returns the disk size of the image
Returns an image page link for the image
Get the index of this image in the album, taking sorting into account.
string getIPTCTag(
string
$tag,
$iptc
)
|
|
For internal use--fetches a single tag from IPTC data
Parameters:
|
string |
$tag: |
the metadata tag sought |
|
|
$iptc: |
|
array getIPTCTagArray(
string
$tag,
$iptc
)
|
|
For internal use--fetches the IPTC array for a single tag.
Parameters:
|
string |
$tag: |
the metadata tag sought |
|
|
$iptc: |
|
Returns the location field of the image
Returns an array of EXIF data
Return the previous Image
Returns true if the image is set visible
string getSizedImage(
int
$size
)
|
|
Returns a path to a sized version of the image
Parameters:
|
int |
$size: |
how big an image is wanted |
Redefined in descendants as:
Returns the sort order value of the image
Returns the state field of the image
Returns the tags of the image
string getThumb(
[
$type = 'image']
)
|
|
Get a default-sized thumbnail of this image.
Parameters:
Redefined in descendants as:
s getThumbImageFile(
[string
$path = NULL]
)
|
|
Returns the image file name for the thumbnail image.
Parameters:
|
string |
$path: |
override path |
Redefined in descendants as:
Returns the title of this image
Returns the custom watermark name
Returns the width of the image
Returns the custom watermark usage
int moveImage(
Album
$newalbum, [string
$newfilename = null]
)
|
|
Moves an image to a new album and/or filename (rename).
Returns 0 on success and error indicator on failure.
Parameters:
|
Album |
$newalbum: |
the album to move this file to. Must be a valid Album object. |
|
string |
$newfilename: |
the new file name of the image in the specified album. |
string prepIPTCString(
string
$iptcstring, string
$characterset
)
|
|
Returns the IPTC data converted into UTF8
Parameters:
|
string |
$iptcstring: |
the IPTC data |
|
string |
$characterset: |
the internal encoding of the data |
bool renameImage(
string
$newfilename
)
|
|
Renames an image to a new filename, keeping it in the same album. Convenience for moveImage($image->album, $newfilename).
Returns true on success and false on failure.
Parameters:
|
string |
$newfilename: |
the new file name of the image file. |
void setCity(
string
$city
)
|
|
Stores the city field of the image
Parameters:
|
string |
$city: |
text for the city |
void setCommentsAllowed(
bool
$commentson
)
|
|
Sets the comments allowed flag on the image
Parameters:
|
bool |
$commentson: |
true if they are allowed |
void setCopyright(
string
$copyright
)
|
|
Stores the text for the copyright field of the image
Parameters:
|
string |
$copyright: |
text for the copyright field |
void setCountry(
string
$country
)
|
|
Stores the country field of the image
Parameters:
|
string |
$country: |
text for the country filed |
void setCredit(
string
$credit
)
|
|
Stores the credit field of the image
Parameters:
|
string |
$credit: |
text for the credit field |
void setCustomData(
string
$val
)
|
|
Sets the custom data field
Parameters:
|
string |
$val: |
the value to be put in custom_data |
void setDateTime(
string
$datetime
)
|
|
Stores the date of the image
Parameters:
|
string |
$datetime: |
the date |
void setDesc(
string
$desc
)
|
|
Stores the description of the image
Parameters:
|
string |
$desc: |
text for the description |
void setLocation(
string
$location
)
|
|
Stores the location field of the image
Parameters:
|
string |
$location: |
text for the location |
void setShow(
bool
$show
)
|
|
Sets the visibility of the image
Parameters:
void setSortOrder(
int
$sortorder
)
|
|
Sets the sort order value of the image
Parameters:
|
int |
$sortorder: |
the order the images should appear in |
void setState(
string
$state
)
|
|
Stores the state field of the image
Parameters:
|
string |
$state: |
text for the state |
void setTags(
string
$tags
)
|
|
Sets the tags of the image
Parameters:
|
string |
$tags: |
the tag list |
void setTitle(
string
$title
)
|
|
Stores the title of this image
Parameters:
|
string |
$title: |
text for the title |
void setWatermark(
string
$wm
)
|
|
Set custom watermark
Parameters:
void setWMUse(
$use
$use
)
|
|
Sets the custom watermark usage
Parameters:
Update this object's values for width and height.
Redefined in descendants as: