Skip to content

ksclarke/jiiify-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jiiify-image  Build Status Codacy Badge Known Vulnerabilities Maven Javadocs

A IIIF Image API library for Java. It does not contain a server. It's meant to be used in a server or it can be used from a command line / GUI application that generates images from files on disk or byte arrays.

This is a work in progress. Not everything is supported yet. In particular, right now it just supports JPEGs, PNGs, TIFs, and GIFs.

A very simple example:

final Image image = ImageFactory.getImage(new File("src/test/resources/images/test.tif"));

image.resizeTo(1000, 1000).write(Format.JPG, new File("tif-resized.jpg"));

A slightly more complicated example:

final Image image = ImageFactory.getImage(new File("src/test/resources/images/test.tif"));
final String id = UUID.randomUUID().toString();
final Region region = new Region(0, 0, 1000, 1000);
final Size size = new Size(500, 500);
final Rotation rotation = new Rotation(45);
final Request request = new Request(id, "/iiif", region, size, rotation, Quality.COLOR);

image.transform(request).write(format.JPG, new File("tif-transformed.jpg"));

And another example:

final Image image = ImageFactory.getImage(new File("src/test/resources/images/test.tif"));
final Request request = Request.parse("/iiif/ASDF123/0,0,1000,1000/500,500/45/default.jpg");
final Format format = request.getFormat();

image.transform(request).write(format, new File("tif-transformed." + format.getExtension());

Getting Started

To check out and build the project, type on the command line:

git clone https://github.com/ksclarke/jiiify-image.git
cd jiiify-image
mvn install

This will put the jar in your local Maven repository and you can reference it from your project.

To build the Javadocs, from the command line, run: mvn javadoc:javadoc

Contact

If you have questions about jiiify-image feel free to ask or, if you encounter a problem, please feel free to open an issue in the project's issue queue.