[MOD] update to support BaseX 9.4.5 and use thumbnailator 4.13
This commit is contained in:
		
							parent
							
								
									460987bfec
								
							
						
					
					
						commit
						78e8f1b28a
					
				
					 15 changed files with 292 additions and 293 deletions
				
			
		| 
						 | 
				
			
			@ -1,12 +1,12 @@
 | 
			
		|||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<classpath>
 | 
			
		||||
	<classpathentry kind="src" path="src/java"/>
 | 
			
		||||
	<classpathentry kind="lib" path="src/main/content/thumbnailator-0.4.8.jar"/>
 | 
			
		||||
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
 | 
			
		||||
		<attributes>
 | 
			
		||||
			<attribute name="module" value="true"/>
 | 
			
		||||
		</attributes>
 | 
			
		||||
	</classpathentry>
 | 
			
		||||
	<classpathentry kind="lib" path="lib/BaseX924.jar"/>
 | 
			
		||||
	<classpathentry kind="lib" path="lib/BaseX945.jar"/>
 | 
			
		||||
	<classpathentry kind="lib" path="src/main/content/thumbnailator-0.4.13.jar"/>
 | 
			
		||||
	<classpathentry kind="output" path="build/classes"/>
 | 
			
		||||
</classpath>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										12
									
								
								dist/doc/thumbnailator.xqm.xml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								dist/doc/thumbnailator.xqm.xml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0">
 | 
			
		||||
  <xqdoc:control>
 | 
			
		||||
    <xqdoc:date>2018-06-29T19:13:26.072+01:00</xqdoc:date>
 | 
			
		||||
    <xqdoc:date>2021-02-16T23:01:20.669Z</xqdoc:date>
 | 
			
		||||
    <xqdoc:version>1.1</xqdoc:version>
 | 
			
		||||
  </xqdoc:control>
 | 
			
		||||
  <xqdoc:module type="library">
 | 
			
		||||
| 
						 | 
				
			
			@ -10,18 +10,18 @@
 | 
			
		|||
      <xqdoc:description>Generate image thumbnails using the thumbnailator library.</xqdoc:description>
 | 
			
		||||
      <xqdoc:see>https://github.com/coobird/thumbnailator</xqdoc:see>
 | 
			
		||||
      <xqdoc:author>andy bunce</xqdoc:author>
 | 
			
		||||
      <xqdoc:version>0.5</xqdoc:version>
 | 
			
		||||
      <xqdoc:version>0.6</xqdoc:version>
 | 
			
		||||
    </xqdoc:comment>
 | 
			
		||||
  </xqdoc:module>
 | 
			
		||||
  <xqdoc:namespaces>
 | 
			
		||||
    <xqdoc:namespace prefix="thumbnails" uri="expkg-zone58:image.thumbnailator"/>
 | 
			
		||||
    <xqdoc:namespace prefix="Thumbs" uri="org.expkgzone58.image.Thumbs"/>
 | 
			
		||||
  </xqdoc:namespaces>
 | 
			
		||||
  <xqdoc:imports>
 | 
			
		||||
    <xqdoc:import type="library">
 | 
			
		||||
      <xqdoc:uri>org.expkgzone58.image.Thumbs</xqdoc:uri>
 | 
			
		||||
    </xqdoc:import>
 | 
			
		||||
  </xqdoc:imports>
 | 
			
		||||
  <xqdoc:namespaces>
 | 
			
		||||
    <xqdoc:namespace prefix="thumbnails" uri="expkg-zone58:image.thumbnailator"/>
 | 
			
		||||
    <xqdoc:namespace prefix="Thumbs" uri="org.expkgzone58.image.Thumbs"/>
 | 
			
		||||
  </xqdoc:namespaces>
 | 
			
		||||
  <xqdoc:variables/>
 | 
			
		||||
  <xqdoc:functions>
 | 
			
		||||
    <xqdoc:function arity="2">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										
											BIN
										
									
								
								dist/thumbnailator-8.0.1.xar
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								dist/thumbnailator-8.0.1.xar
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								lib/BaseX945.jar
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								lib/BaseX945.jar
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
 | 
			
		||||
<jardesc>
 | 
			
		||||
    <jar path="ex-thumbnailator/src/main/content/thumbhelper-7.0.0.jar"/>
 | 
			
		||||
    <jar path="ex-thumbnailator/src/main/content/thumbhelper-8.0.0.jar"/>
 | 
			
		||||
    <options buildIfNeeded="true" compress="true" descriptionLocation="/ex-thumbnailator/makejar.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="true" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
 | 
			
		||||
    <storedRefactorings deprecationInfo="true" structuralOnly="false"/>
 | 
			
		||||
    <selectedProjects/>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,5 +64,8 @@
 | 
			
		|||
  <version num="7.0.1">
 | 
			
		||||
      <!-- generated: {fn:current-dateTime()} -->
 | 
			
		||||
    </version>
 | 
			
		||||
  <version num="8.0.1">
 | 
			
		||||
      <!-- generated: {fn:current-dateTime()} -->
 | 
			
		||||
    </version>
 | 
			
		||||
  </pkg>
 | 
			
		||||
</repo>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,13 +1,13 @@
 | 
			
		|||
# expkg-zone58:image.thumbnailator
 | 
			
		||||
 | 
			
		||||
An XQuery interface to the image thumbnail generator library
 | 
			
		||||
[thumbnailator](https://github.com/coobird/thumbnailator) for BaseX 9+.
 | 
			
		||||
[thumbnailator](https://github.com/coobird/thumbnailator) for BaseX 9.4.5+.
 | 
			
		||||
 | 
			
		||||
Features size, scale, caption, rotate, flip, colorize, watermark. More details at [doc](doc/readme.md)
 | 
			
		||||
 | 
			
		||||
## Versions
 | 
			
		||||
* For Basex 9+ use thumbnailator 7.0.0+
 | 
			
		||||
 | 
			
		||||
* thumbnailator 8 requires Basex 9.4.5+
 | 
			
		||||
* uses thumbnailator 4.13
 | 
			
		||||
## Usage
 | 
			
		||||
 | 
			
		||||
Images are input and output as `xs:base64Binary` items. Inputs typically come from `fetch:binary`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,7 +9,6 @@ import java.io.ByteArrayInputStream;
 | 
			
		|||
import java.io.ByteArrayOutputStream;
 | 
			
		||||
import java.io.File;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.util.Iterator;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import javax.imageio.ImageIO;
 | 
			
		||||
| 
						 | 
				
			
			@ -85,10 +84,8 @@ public class Thumbs extends QueryModule{
 | 
			
		|||
    // build parameters from XML
 | 
			
		||||
    ThumbnailParameter fromNode(final ANode node) throws QueryException, IOException {
 | 
			
		||||
        ThumbnailParameterBuilder builder = new ThumbnailParameterBuilder();
 | 
			
		||||
        for(final ANode element : node.childIter()) {
 | 
			
		||||
 
 | 
			
		||||
        Iterator<ANode> itr = node.children().iterator();
 | 
			
		||||
        while (itr.hasNext()) {
 | 
			
		||||
            ANode element = itr.next();
 | 
			
		||||
            if (element.kind() == Data.ELEM) {
 | 
			
		||||
                String name = Token.string(element.name());
 | 
			
		||||
               // FnTrace.trace(name.getBytes(), "element: ".getBytes(), queryContext);
 | 
			
		||||
| 
						 | 
				
			
			@ -169,9 +166,7 @@ public class Thumbs extends QueryModule{
 | 
			
		|||
 | 
			
		||||
    List<ImageFilter> filters(final ANode filters) throws QueryException, IOException {
 | 
			
		||||
        Pipeline pipeline = new Pipeline();
 | 
			
		||||
        Iterator<ANode> itr = filters.children().iterator();
 | 
			
		||||
        while (itr.hasNext()) {
 | 
			
		||||
            ANode node = itr.next();
 | 
			
		||||
        for(final ANode node : filters.childIter()) {
 | 
			
		||||
            if (node.kind() == Data.ELEM) {
 | 
			
		||||
                switch (Token.string(node.name())) {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
<package xmlns="http://www.basex.org/modules/pkg">
 | 
			
		||||
  <jar>thumbhelper-7.0.0.jar</jar>
 | 
			
		||||
   <jar>thumbnailator-0.4.8.jar</jar>
 | 
			
		||||
  <jar>thumbhelper-8.0.0.jar</jar>
 | 
			
		||||
   <jar>thumbnailator-0.4.13.jar</jar>
 | 
			
		||||
   <class>org.expkgzone58.image.Thumbs</class>
 | 
			
		||||
</package>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/main/content/thumbhelper-8.0.0.jar
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/main/content/thumbhelper-8.0.0.jar
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/main/content/thumbnailator-0.4.13.jar
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/main/content/thumbnailator-0.4.13.jar
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -2,10 +2,11 @@ xquery version "3.1" encoding "UTF-8";
 | 
			
		|||
(:~ Generate image thumbnails using the thumbnailator library. 
 | 
			
		||||
 : @see https://github.com/coobird/thumbnailator
 | 
			
		||||
 : @author andy bunce
 | 
			
		||||
 : @version 0.5 
 | 
			
		||||
 : @version 0.6 
 | 
			
		||||
 :)
 | 
			
		||||
module namespace thumbnails = 'expkg-zone58:image.thumbnailator';
 | 
			
		||||
import module namespace Thumbs = "org.expkgzone58.image.Thumbs";
 | 
			
		||||
 | 
			
		||||
(:~
 | 
			
		||||
 : generate scaled version of source image with maximum dimension of size
 | 
			
		||||
 : @param $source base64Binary (streamed?) e.g from `fetch:binary`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
<package xmlns="http://expath.org/ns/pkg" name="https://github.com/expkg-zone58/ex-thumbnailator"
 | 
			
		||||
	abbrev="thumbnailator" version="7.0.1" spec="1.0">
 | 
			
		||||
	abbrev="thumbnailator" version="8.0.1" spec="1.0">
 | 
			
		||||
 | 
			
		||||
	<title>An XQuery interface to thumbnailator the thumbnail generator library.</title>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue