IIIF and Jpeg2000 now working! - Here's How

135 views
Skip to first unread message

Chris Clawson

unread,
Apr 25, 2022, 6:22:07 PM4/25/22
to DSpace Technical Support
       

The following procedure succeeded in enabling Jpeg2000 (JP2) format images to be served out of DSpace 7.2, under the new IIIF support with the Cantaloupe 5 image server installed and items enabled with the specifically added metadata value 'dspace.​iiif.​enabled ' and a value of 'true' set. This is a web server running under Ubuntu 20.04.

It took me a while to understand that with iiif, it is this new image server which delivers images to the client. DSpace is showing the user an iiif enabled item and the Mirador viewer has requested a default display of the image (from Cantaloupe). The user then may choose a full screen view or any other sort of zoom level. The viewer makes updated requests to the Cantaloupe image server and it responds with the new data.

This has all worked fine for my DS7.2 install, except our limited storage has prevented uploading large size image files. The JPEG2000 format is very efficient in multiple resolution images and is capable of amazing levels of good looking compression ratios, so this seemed to be the best option for us to support IIIF. It didn't work with our default installation. Here is how we fixed it:

The mime type 'image/jp2' is not defined in the DSpace Bitstream Format registry. Without defining this, you will not be able to serve the images.

       
  1. (Logged in as administrator) go to    Registries > Format. This opens the Bitstream Format Registry.  

  2. (Green button) “Add a new    bitstream format”.  

  3. (add the following) Name =    image/jp2, MIME Type = image/jp2, Description = Jpeg2000, File    extensions = jp2 (save)

This will allow the image to be properly recognized when added to the item.

Your server now probably needs libraries to tell the Cantaloupe image server how to deal with the jpeg2000 images. My site has installed the OpenJpeg libraries, with the following command:          

apt install libopenjp2-7   libopenjp2-tools -y  

Now edit the cantaloupe.properties configuration file. Mine is located at /opt/cantaloupe_config .  

vi  /opt/cantaloupe_config/cantaloupe.properties         

Edit this file to define the following  

a) processor.selection_strategy = ManualSelectionStrategy

b) processor.ManualSelectionStrategy.jp2 = OpenJpegProcessor

c) OpenJpegProcessor.path_to_binaries    = /usr/bin/opj_decompress


   
7. (Save the file)                
       

    8. (restart Cantaloupe) systemctl restart cantaloupe.service  

    You may check Cantaloupe's status by    the command =

    systemctl status cantaloupe.service

    and see a    returning message, like:  

    ( Format.JPEG2000:  com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageWriter )

You may now create new items and add bitstream images of the jp2 format. CAUTION, it is not all that common to have transcoding software that can produce compatible jp2. Some of my utilities claim they can but they do not work with DSpace. I have been having good luck using Irfanview and even ImageMagick. Much more experimentation is needed here to create the perfect, zoomable image. I hope this is a useful start for those interested.              

Thank you so much to Mohammad S. AlMutairi and Tim Donohue for providing critical information in getting this to work!


Reply all
Reply to author
Forward
0 new messages