GithubHelp home page GithubHelp logo

webjpip.js's Introduction

webjpip.js

An end to end solution for Pure Web standard JPIP client written in Javascript. This library contains a ready to use plugin for Leaflet and Cesium viewers, and can show a standard Jpeg2000 image published by a standard JPIP server. Progressive display of quality layers is supported.

The server side that this library assumes is a standard HTTP-JPIP server (except of a simple HTTP server for static file access, of course). The kdu_server comes with the Kakadu library is a good starting point, except some issues:

  • The kdu_server is only a preview server. The main issue we've found is that after some clients it refuses creating a new channel and serves the clients statelessly. The webjpip.js throws a "Cannot extract cid" exception in such case.
  • This server does not expose the CORS and "expose-headers" HTTP headers. If you have a license for the full Kakadu library which includes the source code, you can edit it very easily, otherwise Use proxy to overcome this limitation and add the headers.

The library implements features of JPIP and Jpeg2000 standards that we've found useful for us. For the Jpeg2000 files we have, the libarary is an end to end solution to view Jpeg2000 images on the viewer. The library uses the excellent Jpeg2000 decoder jpx.js which is part of the Mozilla/pdf.js repository (however, this is not the original jpx.js decoder as we had to add some features like decoding a small region in the image).

This library still doesn't have an official release and should be considered as alpha version. Notice that we have poor experience in web development, thus you may find a lot of issues related to web development. We also didn't create a minified version of the library and a full documentation. I'm currently trying to refactor the library, particularly split the library into some more general purposes Javascript libraries and enhancing internal API (see my other repositories: AsyncProxy.js, ResourceScheduler.js, ImageDecoderFramework.js which are still in construction).

Currently the (known) unsupported features are:

Codestream content features:

  • Non uniform structure of components - non-1 component scale or existance of COC (Coding-style COmponent segment) (i.e. different resolutions of different components, non-1 component scale, different precinct size, etc.).
  • Precinct size which is not aligned to tile size (i.e. first precinct in each tile must be a full precinct).
  • Non uniform structure of tiles - existance of COD (Coding-style Default) except of the main header COD.
  • Markers in tile or main headers other than one of the following: SIZ, COD, QCD, COM.
  • Packet headers which are not within the bitstream - existance of PPM (Packed Packet in Main header) or PPT (Packed Packet in tile header) segments.

JPIP server features:

  • JPIP server that serves JPT (JPIP Tile-parts) stream.
  • Non zero codestream number in JPIP message (usually in Jpeg2000 video files).

Any help or recommendation are welcome.

webjpip.js's People

Contributors

mamazav avatar freekv avatar

Stargazers

José Juan Sánchez avatar Justin Maat avatar Simon Rascovsky MD, M.Sc avatar Erik Ziegler avatar  avatar  avatar

Watchers

James Cloos avatar Slava (Vyacheslav) Kitaeff avatar  avatar  avatar  avatar  avatar

webjpip.js's Issues

Any plan of stable release?

This is great work and I like the idea of pure web-based JPIP interface a lot.
I am trying to adopt this webjpip for my project, I am wondering if there is any recent plan of a stable release ? As I noted the last commit is about a year ago.

Thanks

kdu_server

I tried to get the jpxjpip or other demos up and running but with the latest version of kdu_show I do not succeed at all. I get the info below. Any idea where to start? I could go through the code of kdu_server but any hint would be appreciated.
Thanks!

<< GET
/A012_C005_0516BC_001_1099124.jp2?type=jpp-stream&stream=0&len=10240&qid=1&cnew
=http HTTP/1.1
<< Host: XXXXXXXX:8888
<< Connection: keep-alive
<< User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36
<< Origin: http://localhost
<< Accept: /
<< Referer:
http://localhost/jpip/wrappers/jpxjpipimage/jpxjpipimageworkers/codestreamclien
tmanagerworker.js
<< Accept-Encoding: gzip, deflate, sdch
<< Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
<<

New channel request accepted locally
    Assigned channel ID: JPH_020B82F74A5DFD69

>> HTTP/1.1 200 OK
>> JPIP-cnew: cid=JPH_020B82F74A5DFD69,path=jpip,transport=http
>> JPIP-qid:1
>> Cache-Control: no-cache
>> Transfer-Encoding: chunked
>> Content-Type: image/jpp-stream
>>
>> 10c

>> 0
>>

Disconnecting client
    File = "a012_c005_0516bc_001_1099124.jp2"
    Channel transport = "http" (1)
    Disconnect time = Fri Feb 19 14:38:46 2016
    Connected for 10.050763 seconds
    Total bytes transmitted = 458
    Number of requests = 1
    Number of requests not pre-empted = 1
    Average bytes served per request not pre-empted = 458.000000
    Number of primary channel attachment events = 1

Enabling CORS for kdu_server and kdu_server alternatives

Hi,

In the README you mention its very easy to add the necessary headers to kdu_server messages to enable CORS and expose the headers. What edits do you recommend to do so? I have a full Kakadu licence for V8.0.6.

Also, any open-source alternatives to kdu_server you found useful and worked for webjpip, for instance OpenJPIP?

Thanks

Edit:
I'm currently using a node.js proxy which seems to work, but I'd imagine its ideal to forego the proxy altogether and instead have kdu_server enable CORS directly.

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.