README.md 2.16 KB
Newer Older
1
2
3
4
5
6
7
8
9
Repository Image manipulation service
=====================================

This comprises an image manipulation service used in combination with ImageMagick's `convert` utility.
This service assumes that ImageMagick is installed somewhere.

The endpoint location is configurable. Any path appended to that endpoint root will be used
as a path to a Fedora Resource. The `options` parameter can be used to add output parameters
to ImageMagick. The `Accept` header is used to change the format of the image. By default,
acoburn's avatar
acoburn committed
10
11
12
13
14
15
16
17
the output is JPEG, but any format listed in the configuration under `valid.formats` can be used.
By default, the valid output formats are `image/tiff`, `image/jp2` and `image/jpeg`.

An example:

    curl http://localhost:9081/image/path/to/binary?options=-resize%20400x400 -H"Accept: image/jpeg"

The service is defined to operate on any `fedora:Binary` resources with a MIMEType of `image/*`.
18
19
20
21
22
23

Building
--------

To build this project use

24
    gradle install
25
26
27
28
29
30
31
32
33

Deploying in OSGi
-----------------

This projects can be deployed in an OSGi container. For example using
[Apache Karaf](http://karaf.apache.org) version 4.x or better, you can run the following
command from its shell:

    feature:repo-add mvn:edu.amherst.acdc/acrepo-karaf/LATEST/xml/features
34
    feature:install acrepo-exts-image
35
36
37
38
39

Configuration
-------------

The application can be configured by creating the following configuration
40
file `$KARAF_HOME/etc/edu.amherst.acdc.exts.image.cfg`. The following values
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
are available for configuration:

The base url of the fedora repository and any authentication parameters

    fcrepo.baseUrl=localhost:8080/fcrepo/rest
    fcrepo.authUsername=
    fcrepo.authPassword=

The acceptable output formats for images

    valid.formats=jpeg,jp2,tiff

The path to the `convert` utility

    convert.path=convert

The port on which the service is made availalbe

59
    rest.port=9105
60
61
62
63
64
65
66
67
68
69
70
71
72
73

The hostname on which the service is available

    rest.host=localhost

The prefix for the service

    rest.prefix=/image

By editing this file, any currently running routes will be immediately redeployed
with the new values.

For more help see the [Apache Camel](http://camel.apache.org) documentation