This module provides function to do the following basic image operations:
The following image formats are supported:
The errors raised by functions of this module have the namespace http://zorba.io/modules/image/error (associated with prefix ierr).
compress
($image as xs:base64Binary, $quality as xs:unsignedInt) as xs:base64Binary external
Compresses the passed image. |
convert-svg-string
($svg as xs:string, $format as xs:string) as xs:base64Binary
Converts an SVG image to a supported image format. |
convert-svg
($svg as element(svg:svg), $format as xs:string) as xs:base64Binary
Converts an SVG image to a supported image format. |
convert
($image as xs:base64Binary, $format as xs:string) as xs:base64Binary
Converts an image to another format. |
create
($width as xs:unsignedInt, $height as xs:unsignedInt, $format as xs:string) as xs:base64Binary
Creates an empty image with background color white. |
equals
($image1 as xs:base64Binary, $image2 as xs:base64Binary) as xs:boolean external
Compares two images. |
exif
($image as xs:base64Binary, $tag as xs:string) as xs:string? external
Reads exif information from an image. |
format
($image as xs:base64Binary) as xs:string external
Returns the format of the passed image. |
height
($image as xs:base64Binary) as xs:unsignedInt external
Returns the height of the passed image. |
width
($image as xs:base64Binary) as xs:unsignedInt external
Returns the width of the passed image. |
declare function basic:compress($image as xs:base64Binary, $quality as xs:unsignedInt) as xs:base64Binary external
Compresses the passed image.
Compressing means lowering the quality and reducing the size.
declare function basic:convert-svg-string($svg as xs:string, $format as xs:string) as xs:base64Binary
Converts an SVG image to a supported image format.
declare function basic:convert-svg($svg as element(svg:svg), $format as xs:string) as xs:base64Binary
Converts an SVG image to a supported image format.
declare function basic:convert($image as xs:base64Binary, $format as xs:string) as xs:base64Binary
Converts an image to another format.
declare function basic:create($width as xs:unsignedInt, $height as xs:unsignedInt, $format as xs:string) as xs:base64Binary
Creates an empty image with background color white.
declare function basic:equals($image1 as xs:base64Binary, $image2 as xs:base64Binary) as xs:boolean external
Compares two images.
declare function basic:exif($image as xs:base64Binary, $tag as xs:string) as xs:string? external
Reads exif information from an image.
This function works for JPEG and TIFF images only.
It returns empty sequence if no exif information matching the passed tag is found.
declare function basic:format($image as xs:base64Binary) as xs:string external
Returns the format of the passed image.
declare function basic:height($image as xs:base64Binary) as xs:unsignedInt external
Returns the height of the passed image.
declare function basic:width($image as xs:base64Binary) as xs:unsignedInt external
Returns the width of the passed image.