Go to file
2017-04-21 15:09:36 +01:00
.settings task interface and java helper 2017-04-21 14:48:37 +01:00
dist readme.md 2017-04-21 15:09:36 +01:00
src readme.md 2017-04-21 15:09:36 +01:00
tools task interface and java helper 2017-04-21 14:48:37 +01:00
.classpath task interface and java helper 2017-04-21 14:48:37 +01:00
.gitignore task interface and java helper 2017-04-21 14:48:37 +01:00
.project task interface and java helper 2017-04-21 14:48:37 +01:00
catalog.xml task interface and java helper 2017-04-21 14:48:37 +01:00
LICENSE update to thumbnailator 0.4.8 2016-04-16 22:21:17 +01:00
makejar.jardesc task interface and java helper 2017-04-21 14:48:37 +01:00
package.xml readme.md 2017-04-21 15:09:36 +01:00
readme.md readme.md 2017-04-21 15:09:36 +01:00

expkg-zone58.image.thumbnailator

An XQuery interface to the thumbnail generator library thumbnailator.

Tested against BaseX 8.6.2

Usage

Simple

import module namespace t="expkg-zone58:image.thumbnailator";

fetch:binary("http://images.metmuseum.org/CRDImages/ep/original/DT46.jpg")
=>t:size(80,60)

Tasks

This function takes an XML description of the operations to apply to generate the thumbnail.

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="100" height="100"/>
    <filters>             
        <colorize color="green" alpha=".5"/>      
        <caption position="CENTER">Some Text here</caption>
        <rotate angle="15"/>
        <canvas height="500" width="500" position="TOP_LEFT" color="black"/> 
        <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 for this is provided

Installation

The library is packaged in the EXpath xar format with the thumbnailator jar included. See releases for installation instructions.

Tests

test.xqm script uses the BaseX Unit module

License

  • ex-thumbnailator Copyright (c) 2017, Andy Bunce. (Apache 2 License).
  • thumbnailator Copyright (c) Chris Kroells (MIT License).

todo

scale sourceregion