A RESTful browser for eXist Function Modules


http://exist-db.org/xquery/image
A module for performing operations on Images stored in the eXist db

image:crop($image as xs:base64Binary, $dimension as xs:integer*, $mimeType as xs:string) xs:base64Binary?
Crop the image $image to a specified dimension. If no dimensions are specified, then the default values are 'y1 = 0', 'x1 = 0', 'x2 = 100' and 'y2 = 100'.
$imageThe image data
$dimensionThe maximum dimension of the cropd image. expressed in pixels (x1, y1, x2, y2). If empty, then the default values are are 'y1 = 0', 'x1 = 0', 'x2 = 100' and 'y2 = 100'.
$mimeTypeThe mime-type of the image

Returns the cropd image or an empty sequence if $image is invalid

image:get-height($image as xs:base64Binary) xs:integer?
Gets the Height of the image passed in, returning an integer of the images Height in pixels or an empty sequence if the image is invalid.
$imageThe image data

Returns the height in pixels

image:get-metadata($image as xs:base64Binary, $native-format as xs:boolean) node()?
Gets the metadata of the image passed in, returning the images XML metadata.
$imageThe image data
$native-formatWhen true metadata of the images native format is returned, otherwise common java ImageIO metadata is returned.

Returns the image metadata

Deprecated: Use the contentextraction module instead This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.

image:get-width($image as xs:base64Binary) xs:integer?
Gets the width of the image passed in, returning an integer of the images width in pixels or an empty sequence if the image is invalid.
$imageThe image data

Returns the width in pixels

image:scale($image as xs:base64Binary, $dimension as xs:integer*, $mimeType as xs:string) xs:base64Binary?
Scale the image image to a specified dimension. If no dimensions are specified, then the default values are 'maxheight = 100' and 'maxwidth = 100'.
$imageThe image data
$dimensionThe maximum dimension of the scaled image. expressed in pixels (maxheight, maxwidth). If empty, then the default values are 'maxheight = 100' and 'maxwidth = 100'.
$mimeTypeThe mime-type of the image

Returns the scaled image or an empty sequence if $image is invalid

image:thumbnail($collection as xs:anyURI, $thumbnail-location as xs:anyURI?, $dimension as xs:integer*, $prefix as xs:string?) xs:string*
Generate thumbnails from the given database collection
$collectionThe URI to the collection
$thumbnail-locationThe location in the database where the thumbnails should be created, this can be a local path, with the prefix 'xmldb:' a absolute path within the database or with 'rel:' path relative to the given $collection. You can leave this empty then the default is 'rel:/thumbs'.
$dimensionThe dimension of the thumbnails, if empty then the default values are 'maxheight = 100' and 'maxwidth = 100', the first value is 'maxheight' and the second 'maxwidth'.
$prefixThe prefix to append to the thumbnail filenames

Returns the result
Return to list of all modules