Git Product home page Git Product logo

cantaloupe's Introduction

๐Ÿˆ Cantaloupe

High-performance dynamic image server in Java

Users

Get started with a release build.

Developers

Build & run

Command line

  • mvn clean compile exec:java -Dcantaloupe.config=... will build and run the project using the embedded web server listening on the port(s) specified in cantaloupe.properties.

  • mvn clean package -DskipTests will build a release JAR in the target folder, which can be run via:

    java -cp cantaloupe-{version}.jar -Dcantaloupe.config=... edu.illinois.library.cantaloupe.StandaloneEntry

IDE

  1. Add a new run configuration using the "Java Application" template or similar.
  2. Set the main class to edu.illinois.library.cantaloupe.StandaloneEntry and add the -Dcantaloupe.config=... VM option.

Test

Testing the code

Copy test.properties.sample to test.properties and fill in whatever info you have.

The code tests are structured into three Maven profiles:

1. Tests with no dependencies

mvn clean test -Pnodeps will run only the tests that have no dependencies on third-party services and do not require any external tools or libraries.

2. Tests with free dependencies

mvn clean test -Pfreedeps will run all of the above tests, plus any that depend on open-source tools or libraries. These are the tests run in continuous integration. The following dependencies are required:

  • MinIO (for S3SourceTest & S3CacheTest)
  • FFmpeg (for FfmpegProcessorTest)
  • Grok (for GrokProcessorTest)
  • OpenJPEG (for OpenJpegProcessorTest)
  • TurboJPEG with Java binding (for TurboJpegProcessorTest)
  • Redis (for RedisCacheTest)

3. All tests

mvn clean test will run all tests including the ones above. The following additional dependencies are required:

  • Kakadu native library (for KakaduNativeProcessorTest) - see the KakaduNativeProcessor section of the user manual for information.
  • A Microsoft Azure account

Docker

Because it can be a chore to install all of the dependencies needed to get all of the tests in the freedeps profile passing, there is a docker-compose.yml file available that will spin up all needed dependencies in separate containers, and run the tests in another container. From the project root directory, invoke:

docker-compose -f docker/{platform}/docker-compose.yml up --build --exit-code-from cantaloupe.

Output testing

There is an output tester tool that enables visual inspection of image output.

Performance testing

Performance tests use JMH. Run them with mvn clean test -Pbenchmark.

Contribute

The suggested process for contributing code changes is:

  1. Submit a "heads-up" issue in the tracker, ideally before beginning any work.
  2. Create a fork.
  3. Create a feature branch, starting from either release/x.x or develop (see the "Versioning" section.)
  4. Make your changes.
  5. Commit your changes (git commit -am 'Add some feature').
  6. Push the branch (git push origin feature/my-new-feature).
  7. Create a pull request.

Other Notes

Configuration keys

Different application versions may require different configuration file keys. It's good practice to use a dedicated configuration file for each version. Key changes are documented in UPGRADING.md.

Versioning

Cantaloupe roughly uses semantic versioning. Major releases (n) involve major redesign that breaks backwards compatibility significantly. Minor releases (n.n) either do not break compatibility, or only in a minor way. Patch releases (n.n.n) are for bugfixes only.

Branching

Cantaloupe uses a basic version of the Gitflow branching model. develop is the main branch that tracks the current state of the next non-bugfix release. Significant features branch off of that into feature branches (feature/feature-name), from which they can be integrated into a particular release.

When a major or minor version in develop is ready for release, it merges into a release/n.n branch, where the release is tagged and the release archive is created.

Bugfixes that would increment a minor version of a release are applied to its release branch and merged back into develop.

Prerelease

  1. Run the Maven Verifier plugin (mvn verify -DskipTests=true)
  2. Run an OWASP dependency check (mvn org.owasp:dependency-check-maven:check)
  3. Run Spotbugs (mvn clean compile spotbugs:spotbugs spotbugs:gui)
  4. Run the Endpoint tests
  5. Finalize the code to be released, addressing any relevant milestone issues, TODOs, etc.
  6. Finalize the documentation, including the website, user manual, and change log

Releasing

  1. Merge into release/vX.X
  2. Update the version in pom.xml and commit this change
  3. git push origin release/x.x
  4. Wait for CI tests to pass
  5. Tag the release: git tag -a v{version} -m 'Tag v{version}'; git push --tags
  6. Wait for GitHub Actions to add the release artifact to the tag
  7. Add the change log to the release on GitHub
  8. Close the release's issue milestone
  9. Deploy the updated website (if necessary)

License

Cantaloupe is open-source software distributed under the University of Illinois/NCSA Open Source License; see the file LICENSE.txt for terms.

cantaloupe's People

Contributors

adam-vessey avatar adolski avatar cbeer avatar ccare avatar cmhdave avatar jlleitschuh avatar jonathangreen avatar jweisman avatar kaij avatar kinow avatar ksclarke avatar marc-sensenich avatar mejackreed avatar mightymax avatar morrisoncole avatar rrmoelker avatar wwelling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cantaloupe's Issues

ProcessorException: Illegal band size for 16 bit TIFF images

Working with 16 bit gray scale TIFF scientific images, I get an ProcessorException: Illegal band size: should be 0 < size <= 8

Attached is an example that can be used for testing here:
AF41.zip

image

The Error Trace
16:41:04.114 [qtp1349277854-12] INFO e.i.l.c.resource.SourceImageWrangler - FileResolver -> FileProcessor connection between FilesystemReso lver and Java2dProcessor
16:41:04.114 [qtp1349277854-12] INFO e.i.l.c.resolver.FilesystemResolver - Resolved /VB00045122_1/AF41.tif to D:\DEVTOOLS\Jenkins\userContent\pictures\VB00045122_1\AF41.tif
16:41:04.130 [qtp1349277854-12] INFO e.i.l.c.p.imageio.TiffImageReader - createReader(): using it.geosolutions.imageioimpl.plugins.tiff.TIF FImageReader
16:41:04.130 [qtp1349277854-12] DEBUG e.i.l.c.resource.AbstractResource - Read info of /VB00045122_1/AF41.tif in 0 msec
16:41:04.130 [qtp1349277854-12] DEBUG e.i.l.c.resource.AbstractResource - isAuthorized(): delegate script is disabled; allowing.
16:41:04.145 [qtp1349277854-12] DEBUG e.i.l.c.resource.AbstractResource - addNonEndpointOperations(): redactions are disabled; skipping.
16:41:04.145 [qtp1349277854-12] DEBUG e.i.l.c.resource.AbstractResource - addNonEndpointOperations(): watermarking is disabled; skipping.
16:41:04.145 [qtp1349277854-12] DEBUG e.i.l.c.resource.AbstractResource - Read info of /VB00045122_1/AF41.tif in 0 msec
16:41:04.145 [qtp1349277854-12] DEBUG e.i.l.c.p.i.AbstractImageReader - tileAwareRead(): acquiring region 0,0/1024x1024 from 1024x1024 image

16:41:04.176 [qtp1349277854-12] DEBUG e.i.l.c.p.i.AbstractImageReader - readSmallestUsableSubimage(): using a 1024x1024 source image (0x red uction factor)
16:41:04.192 [qtp1349277854-12] ERROR org.restlet.Component.Server - An exception occurred writing the response entity
java.io.IOException: edu.illinois.library.cantaloupe.processor.ProcessorException: Illegal band size: should be 0 < size <= 8
at edu.illinois.library.cantaloupe.resource.ImageRepresentation.doWrite(ImageRepresentation.java:139)
at edu.illinois.library.cantaloupe.resource.ImageRepresentation.write(ImageRepresentation.java:90)
at org.restlet.engine.adapter.ServerCall.writeResponseBody(ServerCall.java:513)
at org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:457)
at org.restlet.ext.servlet.internal.ServletCall.sendResponse(ServletCall.java:421)
at org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:187)
at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:144)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:524)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Unknown Source)
Caused by: edu.illinois.library.cantaloupe.processor.ProcessorException: Illegal band size: should be 0 < size <= 8
at edu.illinois.library.cantaloupe.processor.Java2dProcessor.process(Java2dProcessor.java:222)
at edu.illinois.library.cantaloupe.resource.ImageRepresentation.doWrite(ImageRepresentation.java:132)
... 31 common frames omitted
Caused by: javax.imageio.IIOException: Illegal band size: should be 0 < size <= 8
at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(Unknown Source)
at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(Unknown Source)
at edu.illinois.library.cantaloupe.processor.imageio.JpegImageWriter.write(JpegImageWriter.java:134)
at edu.illinois.library.cantaloupe.processor.imageio.ImageWriter.write(ImageWriter.java:59)
at edu.illinois.library.cantaloupe.processor.Java2dProcessor.process(Java2dProcessor.java:220)
... 32 common frames omitted

Customizable base URLs

Make base URLs (scheme+host+port+base path) in JSON-LD @id, Link headers, etc., customizable for reverse-proxy scenarios.

Image redaction

Should be able to return an array of rects from authorized?() to redact regions of images.

  • If redacted area encompasses part of the requested region, return 200 and the image with redacted region blacked out.
  • If redacted area encompasses the entire requested region, return 403.

Web-based administration

JavaScript-based admin module located at /admin. Protected by HTTP Basic auth. Loads a config file via GET and writes it back via POST. An alternative to hand-editing the config file.

Standalone binds to localhost and is not configurable

Hi!

I'm trying to expose the standalone server to an external IP but this is blocking that:

https://github.com/medusa-project/cantaloupe/blob/b56ca1103a644fe99522df608a02c6da3d629f14/src/main/java/edu/illinois/library/cantaloupe/WebServer.java#L177

(It changed sometime after 2.2 fwiw)

It would be nice to see this changed to either:
connector.setHost("0.0.0.0");

Or if you want to allow for the option of not binding to every IP, a config option like how ports are configured would be great. Maybe getHttpHost() to match the similar getHttpPort()?

If this is something you agree should change, but don't have time to look at it please let me know how you'd prefer this to be handled and I can open a PR.

Thanks!

Authorization

Open to suggestions on how this should work. I was thinking a delegate method that looks something like:

module Cantaloupe
  ##
  # @param identifier [String]
  # @param operations [Hash] ??
  # @param request_uri [String]
  # @param request_headers [Hash]
  # @param client_ip [String]
  # @param cookies [Array]
  # @return [Boolean]
  #
  def self.authorized?(identifier....)
    ..
  end
end

JdoCache

In progress in feature/jdocache

Java2dProcessor fails to read JPEG image

Source image: http://www.riecks.com/pickup/dia-samples/images/page1.html

Demo URL: https://iiif-dev.library.illinois.edu/dls/iiif/2/1070%2F2451%2Fonline%2FFalkenstein%2C+Bob-1.psd.jpg/full/400,/0/default.jpg

Processor: Java2dProcessor
Versions affected: <= 3.1.2

Possibly relevant: http://stackoverflow.com/questions/10416378/imageio-read-illegal-argument-exception-raster-bands-colour-space-components

Trace:

2016-07-27 14:21:24,671 ERROR [qtp1051754451-70] o.r.C.Server [Slf4jLogger.java:230] An exception occurred writing the response entity
java.io.IOException: java.lang.IllegalArgumentException: Numbers of source Raster bands and source color space components do not match
    at edu.illinois.library.cantaloupe.resource.ImageRepresentation.doWrite(ImageRepresentation.java:139) ~[classes/:na]
    at edu.illinois.library.cantaloupe.resource.ImageRepresentation.write(ImageRepresentation.java:90) ~[classes/:na]
    at org.restlet.engine.adapter.ServerCall.writeResponseBody(ServerCall.java:513) ~[org.restlet-2.3.7.jar:na]
    at org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:457) ~[org.restlet-2.3.7.jar:na]
    at org.restlet.ext.servlet.internal.ServletCall.sendResponse(ServletCall.java:421) ~[org.restlet.ext.servlet-2.3.7.jar:na]
    at org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:187) ~[org.restlet-2.3.7.jar:na]
    at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:144) [org.restlet-2.3.7.jar:na]
    at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117) [org.restlet.ext.servlet-2.3.7.jar:na]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.server.Server.handle(Server.java:518) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) [Cantaloupe-3.1.2.war:3.1.2]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) [Cantaloupe-3.1.2.war:3.1.2]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
Caused by: java.lang.IllegalArgumentException: Numbers of source Raster bands and source color space components do not match
    at java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:482) ~[na:1.8.0_91]
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.acceptPixels(JPEGImageReader.java:1268) ~[na:1.8.0_91]
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method) ~[na:1.8.0_91]
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1236) ~[na:1.8.0_91]
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:1039) ~[na:1.8.0_91]
    at edu.illinois.library.cantaloupe.processor.ImageIoImageReader.tileAwareRead(ImageIoImageReader.java:559) ~[classes/:na]
    at edu.illinois.library.cantaloupe.processor.ImageIoImageReader.read(ImageIoImageReader.java:350) ~[classes/:na]
    at edu.illinois.library.cantaloupe.processor.Java2dProcessor.process(Java2dProcessor.java:122) ~[classes/:na]
    at edu.illinois.library.cantaloupe.resource.ImageRepresentation.doWrite(ImageRepresentation.java:132) ~[classes/:na]
    ... 30 common frames omitted

Resolving

Hello,
Do you support the resolving of a URL identifier into a file path, using a SQL query to a table in a database?

Eyal

Tiling on demand

Hi,
Our institution is looking to replace our old images server & viewer which are Erez and FSI Viewer. We are pretty much set on the viewer we would be using but we are still looking for an images server. Cantaloup has all the options we are looking for and is one of the servers we are considering. Could you tell me if it's possible to tile images on demand and not beforehand? I am not seeing anything about it in the documentation but I would like to be sure. Looking at all the images servers out there, none are offering this possibility so there is surely a good reason.

Thank you very much!
Francois

"Level 2" cache for non-filesystem resolvers

HttpResolver, JdbcResolver, and AmazonS3Resolver should offer the option to cache source images locally for improved performance.

Rename caches:

  • Level 0: client/proxy
  • Level 1: processed tiles
  • Level 2: full source image

Add StreamResolver.retrieval_strategy = StreamStrategy / CacheStrategy.
CacheStrategy downloads source into L2 cache.

Modify the Cache interface to support L2 cache.

Consistent release package naming

This is a very minor request, but the most recent release has changed the download path pattern from:

..../download/{version}/Cantaloupe-{version}.zip

to:

..../download/v{version}/Cantaloupe-{version}.zip

(the 'v' added). This makes automation tools, such as the one we are using:

https://github.com/MITLibraries/docker-cantaloupe

more difficult to configure. Could there be a predictable/fixed pattern to release downloads?

Bundled JRuby interpreter

Hello,
I wanted to clarify something I read in the 3.1 user manual for your application. In the delegate script section it mentions: "Delegate methods are implemented in Ruby, and invoked by a JRuby interpreter bundled into the image server." but I could never get it to work without manually installing JRuby on the server.

It seemed to be fine last week but now someone restarted our tomcat server and I'm getting the following error:
javax.script.ScriptException: org.jruby.embed.EvalFailedException: (SyntaxError) /opt/jruby-9.1.5.0/lib/ruby/stdlib/net/http.rb:1070: syntax error, unexpected tDOTproxy_uri&.hostname

I noticed it's trying to use the JRuby library I installed and I was wondering if that could be the reason we're having issues. Is there a specific version of JRuby I should install instead?

Thanks for your help,
Fred

Java2dProcessor exception: Inconsistent metadata read from stream

Version: 3.3-SNAPSHOT

URL: https://iiif-dev.library.illinois.edu/dls/iiif/2/378%2F2259%2F2620076%2Faccess%2Fonline%2F32nd+Armored+Regiment+Photo+and+War+Diary%2F32nd+Regiment+D+Company.jpg/square/!256,256/0/default.jpg

Medusa pathname: /378/2259/2620076/access/online/32nd Armored Regiment Photo and War Diary/32nd Regiment D Company.jpg

java.io.IOException: edu.illinois.library.cantaloupe.processor.ProcessorException: Inconsistent metadata read from stream
    at edu.illinois.library.cantaloupe.resource.ImageRepresentation.doWrite(ImageRepresentation.java:139)
    at edu.illinois.library.cantaloupe.resource.ImageRepresentation.write(ImageRepresentation.java:90)
    at org.restlet.engine.adapter.ServerCall.writeResponseBody(ServerCall.java:513)
    at org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:457)
    at org.restlet.ext.servlet.internal.ServletCall.sendResponse(ServletCall.java:421)
    at org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:187)
    at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:144)
    at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)
Caused by: edu.illinois.library.cantaloupe.processor.ProcessorException: Inconsistent metadata read from stream
    at edu.illinois.library.cantaloupe.processor.Java2dProcessor.process(Java2dProcessor.java:222)
    at edu.illinois.library.cantaloupe.resource.ImageRepresentation.doWrite(ImageRepresentation.java:132)
    ... 31 common frames omitted
Caused by: javax.imageio.IIOException: Inconsistent metadata read from stream
    at com.sun.imageio.plugins.jpeg.JPEGMetadata.<init>(JPEGMetadata.java:362)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.getImageMetadata(JPEGImageReader.java:1023)
    at edu.illinois.library.cantaloupe.processor.imageio.JpegImageReader.getMetadata(JpegImageReader.java:37)
    at edu.illinois.library.cantaloupe.processor.imageio.ImageReader.getMetadata(ImageReader.java:134)
    at edu.illinois.library.cantaloupe.processor.Java2dProcessor.process(Java2dProcessor.java:219)
    ... 32 common frames omitted

ImageGearProcessor

Looks interesting, through pricy: https://www.accusoft.com/products/imagegear-java/overview/

Questions:

  • ImageGear for Java vs. ImageGear Professional differences
    • Performance?
    • Is ImageGear Professional C or C++?
      • Usable via JNI/JNA?
  • Differences vs. Java 2D/ImageIO
  • Operation support
    • Crop, scale, transpose/flip, rotate, monochrome, bitonal
      • all in one pass without creating intermediate images?
  • Format support
    • JPEG2000
      • Performance vs. Kakadu/OpenJPEG?
    • TIFF
      • Multi-resolution reading?
      • Tiled reading?
    • JPEG
      • Performance vs TurboJPEG?
    • Very large files?
  • Same output formats as input formats?
  • ImageGear for Java
    • Read from ReadableByteChannels?
    • Write to WritableByteChannels?
    • Pure Java? Just put a JAR in the classpath?

Does Cantaloupe support the IIIF Presentation API?

Alex, greetings and thanks for this new entry to Java based image servers. I have been evaluating various image servers for digital microscopy in the biological sciences and I just discovered Cantaloupe. I will be giving it a spin in the next few days.

An important aspect of my work is the ability to display some image metadata along with the image. Many of the digital microscopy images have file names that encode some metadata. So, it would be useful to display the source file name along with each image. I understand that the IIIF Presentation API supports a rich set of annotations and metadata that can be displayed with each artifact.

Does Cantaloupe support the IIIF Presentation API? Are there any other mechanisms (not based on the Presentation API) to display such simple annotation? Any examples?

Thanks and best regards
Ioannis

FfmpegProcessor

An FfmpegProcessor (using ffmpeg) would make it possible to extract frames from video files.

On the front-end, perhaps this could work like (without modifying the IIIF URL format):

  • ?frame=pct:0.25 to get a frame 25% of the way through
  • ?frame=30 to get frame #30

On the back-end, it would require some additions to the e.i.l.c.image.SourceFormat enum. Also, ImageResource.ImageRepresentation.doWrite(OutputStream) would have to be modified to never stream through video files.

Make KakaduProcessor implement StreamProcessor

KakaduProcessor currently implements only FileProcessor, which means it can only read from files. It uses the equivalent of this command:

kdu_expand -i /path/to/file.jp2 -o /dev/stdout > out.ppm

If it implemented StreamProcessor, it could work with HttpResolver and other resolvers that return streams. The command would be:

kdu_expand -i /dev/stdin -o /dev/stdout < /path/to/file.jp2 > out.ppm

I don't think kdu_jp2info supports reading from streams, so StreamProcessor.getSize() might have to cheat by using ProcessorUtil.getSize(). The StreamProcessor.process() implementation would be substantially similar to FileProcessor.process().

Roadmap?

Hi,

I was looking for an IIIF compatible image server and found this project. I really like it, you have done a great job.

I didn't find any details concerning the road map or the future plans for this project. Could you share some details about it?

I am really interested and intend to use such an image server in a production environment in the near future.

Thanks

Configurable logging

Cantaloupe currently uses slf4j+Logback but just logs everything to stdout. Requirements:

  • rolling log file appender
    • (rolling on what basis?)
  • separate access & error logs
  • configurable log file path
  • configurable error log level

Cache worker should check for corrupt images

cache.server.worker.delete_corrupt = true/false

I don't know about this. It will be very expensive. Also, I don't know if ImageIO is capable of reporting corruption in all/any formats. Are corrupt images a big enough problem to warrant this?

VipsProcessor

The vips command-line tool does not support operation-chaining, making it not very useful. A JNI interface to the Vips API would enable a potentially very fast VipsProcessor.

Error message caused by wrong image file types :The image 'http://ipaddr:8182/iiif/OBJ.tif/full/pct:20/0/default.jpg' cannot be displayed because it contains errors

If the files with unsupported types such as .tif or .jp2 are pull out through the IIIF API standard uri, this error message appears as part of the returned image of black background. As you can see in the attached file.
There may be other ways to cause this error as it is unlikely the message is for a very specific file-type error event.
screenshot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.