[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