XQuery Function Documentation

Search and Browse

http://exist-db.org/xquery/image

java:org.exist.xquery.modules.image.ImageModule

A module for performing operations on Images stored in the eXist db

image:crop

image:crop($image as xs:base64Binary, $dimension as xs:integer*, $mimeType as xs:string) as 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'.

Parameters:
$image The image data
$dimension* The 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'.
$mimeType The mime-type of the image
Returns:
xs:base64Binary? : the cropd image or an empty sequence if $image is invalid

image:get-height

image:get-height($image as xs:base64Binary) as 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.

Parameters:
$image The image data
Returns:
xs:integer? : the height in pixels

image:get-width

image:get-width($image as xs:base64Binary) as 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.

Parameters:
$image The image data
Returns:
xs:integer? : the width in pixels

image:scale

image:scale($image as xs:base64Binary, $dimension as xs:integer*, $mimeType as xs:string) as 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'.

Parameters:
$image The image data
$dimension* The maximum dimension of the scaled image. expressed in pixels (maxheight, maxwidth). If empty, then the default values are 'maxheight = 100' and 'maxwidth = 100'.
$mimeType The mime-type of the image
Returns:
xs:base64Binary? : the scaled image or an empty sequence if $image is invalid

image:thumbnail

image:thumbnail($collection as xs:anyURI, $thumbnail-location as xs:anyURI?, $dimension as xs:integer*, $prefix as xs:string?) as xs:string*

Generate thumbnails from the given database collection

Parameters:
$collection The URI to the collection
$thumbnail-location? The 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'.
$dimension* The 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'.
$prefix? The prefix to append to the thumbnail filenames
Returns:
xs:string* : the result