[fix] thumbnail element

This commit is contained in:
Andy Bunce 2017-04-21 15:06:49 +01:00
parent 57f3c1eee7
commit 3376e6e4db
3 changed files with 13 additions and 6 deletions

View File

@ -13,16 +13,20 @@ Tested against BaseX 8.6.2
import module namespace t="expkg-zone58:image.thumbnailator";
fetch:binary("http://images.metmuseum.org/CRDImages/ep/original/DT46.jpg")
=>t:scale(80,60)
=>t:size(80,60)
```
### Tasks
This function takes an XML description of the operations to apply to generate the thumbnail.
```xml
```xquery
import module namespace t="expkg-zone58:image.thumbnailator";
declare variable $watermark:="C:\Users\andy\git\ex-thumbnailator\src\test\resources\icon.jpg";
let $task:=
<thumbnail>
<size width="500" height="500"/>
<size width="100" height="100"/>
<filters>
<colorize color="green" alpha=".5"/>
<caption position="CENTER">Some Text here</caption>
@ -31,8 +35,11 @@ This function takes an XML description of the operations to apply to generate th
<watermark src="{$watermark}" alpha=".5" position="TOP_LEFT"/>
</filters>
</thumbnail>
return fetch:binary("http://images.metmuseum.org/CRDImages/ep/original/DT46.jpg")
=>t:task($task)
```
A schema is provided.
A schema for this is [provided](./src/content/task.xsd)
## Installation
The library is packaged in the [EXpath](http://expath.org/spec/pkg) xar format with

View File

@ -34,7 +34,7 @@ as xs:base64Binary
: @result base64Binary for thumbnail
:)
declare function thumbnails:task($source as xs:base64Binary,
$task as element(task))
$task as element(thumbnail))
as xs:base64Binary
{
Q{java:org.expkgzone58.image.Thumbs}task($source,$task)

View File

@ -1,5 +1,5 @@
<package xmlns="http://expath.org/ns/pkg" name="https://github.com/expkg-zone58/ex-thumbnailator"
abbrev="thumbnailator" version="4.1.4" spec="1.0">
abbrev="thumbnailator" version="4.1.5" spec="1.0">
<title>An XQuery interface to thumbnailator the thumbnail generator library.</title>
<dependency processor="basex" />