Hi there:


We have Adore-Djatoka installed on a Windows server. We're using an image viewer that relies on Adore-Djatoka, yet it can't display any JP2 files. The viewer's development team believes it has to do with Adore-Djatoka not responding with a true JSON object, causing the backslashes in the Windows path being returned to be misinterpreted. I have found another thread that seems to suggest the same thing (https://sourceforge.net/p/djatoka/mailman/message/26642839/).


Here's a little more detail: Our Drupal website has Islandora installed on it, which includes a viewer for interacting with JP2 files. It appears that when the viewer first loads, the JP2 file gets cached into a tomcat temp directory. The problem we're encountering is this: the viewer requests that Adore-Djatoka returns information about the JP2 image in JSON format. However, the data being returned doesn't appear to be true JSON (http://sourceforge.net/p/djatoka/code/HEAD/tree/src/gov/lanl/adore/djatoka/openurl/OpenURLJP2KMetadata.java#l120), but just a string that has the trappings of JSON. The Islandora developers suggest that since it's not a true "JSONObject()," the backslashes in the "imagefile" path aren't getting properly escaped. So when the data is passed back to the viewer, jQuery misinterprets the backslashes, the path gets corrupted and the image can't load.


I believe the developers are suggesting that the block of code I linked to above should be replaced with something like this:


JSONObject sb = new JSONObject();
sb.put("identifier", r.getIdentifier());
sb.put("imagefile", r.getImageFile());
sb.put("width", r.getWidth());
sb.put("height", r.getHeight());
sb.put("dwtLevels", r.getDWTLevels());
sb.put("levels", r.getLevels());
sb.put("compositingLayerCount", r.getCompositingLayerCount());


Here are my questions:

·         Does this sound like a reasonable cause of the problem I described?

·         To test this, I imagine I'll need to somehow recompile Adore-Djatoka with the above changes in place. Can you offer suggestions on how to do this?




-- slanger