GNOME Bugzilla – Bug 764746
Replace Jasper by OpenJPEG in jp2-load
Last modified: 2018-05-22 12:13:39 UTC
Jasper is the "reference implementation of the codec specified in the JPEG-2000 Part-1 standard" (from https://www.ece.uvic.ca/~frodo/jasper/). Sadly it also has incomplete JPEG-2000 support and is now unmaintained... OpenJPEG is "an open-source JPEG-2000 codec written in C" (from http://www.openjpeg.org). It has better JPEG-2000 support and has the advantage of still being maintained. Code is placed under BSD license, details here: https://github.com/uclouvain/openjpeg/blob/master/LICENSE Proposition is to switch jp2-load implementation from using Jasper to OpenJPEG.
Good idea, do you have a patch?
This is a work in progress, my branch is here: https://gitlab.com/tchaik/gegl/commits/tchaik/wip/jp2
The JPEG 2000 standard defines multiple, different, file formats and OpenJpeg handles some (most) of them throught different codecs (Jasper only support JP2). From openjpeg.h: >typedef enum CODEC_FORMAT { > OPJ_CODEC_UNKNOWN = -1, /*< place-holder */ > OPJ_CODEC_J2K = 0, /*< JPEG-2000 codestream : read/write */ > OPJ_CODEC_JPT = 1, /*< JPT-stream (JPEG 2000, JPIP) : read only */ > OPJ_CODEC_JP2 = 2, /*< JP2 file format : read/write */ > OPJ_CODEC_JPP = 3, /*< JPP-stream (JPEG 2000, JPIP) : to be coded */ > OPJ_CODEC_JPX = 4 /*< JPX file format (JPEG 2000 Part-2) : to be coded */ >} OPJ_CODEC_FORMAT; OpenJpeg does not analyse file content type by itself, thus requiring one to determine the format of the input file beforehand. In its current state, shared-mime-info reports any of these format to be JP2 (image/jp2 MIME type) and this make OpenJpeg crash trying to open a non JP2 file with JP2 codec... A patch has been proposed to better distinguish those formats: https://bugs.freedesktop.org/show_bug.cgi?id=94423
*** Bug 776033 has been marked as a duplicate of this bug. ***
(In reply to Martin Blanchard from comment #3) > The JPEG 2000 standard defines multiple, different, file formats and > OpenJpeg handles some (most) of them throught different codecs (Jasper only > support JP2). From openjpeg.h: > > >typedef enum CODEC_FORMAT { > > OPJ_CODEC_UNKNOWN = -1, /*< place-holder */ > > OPJ_CODEC_J2K = 0, /*< JPEG-2000 codestream : read/write */ > > OPJ_CODEC_JPT = 1, /*< JPT-stream (JPEG 2000, JPIP) : read only */ > > OPJ_CODEC_JP2 = 2, /*< JP2 file format : read/write */ > > OPJ_CODEC_JPP = 3, /*< JPP-stream (JPEG 2000, JPIP) : to be coded */ > > OPJ_CODEC_JPX = 4 /*< JPX file format (JPEG 2000 Part-2) : to be coded */ > >} OPJ_CODEC_FORMAT; > > OpenJpeg does not analyse file content type by itself, thus requiring one to > determine the format of the input file beforehand. > > In its current state, shared-mime-info reports any of these format to be JP2 > (image/jp2 MIME type) and this make OpenJpeg crash trying to open a non JP2 > file with JP2 codec... A patch has been proposed to better distinguish those > formats: > > https://bugs.freedesktop.org/show_bug.cgi?id=94423 I think that whatever loader you can come up with, it needs to at least be able to differentiate the different image types by itself, without outside help. If shared-mime-info isn't new enough for example.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gegl/issues/35.