After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764746 - Replace Jasper by OpenJPEG in jp2-load
Replace Jasper by OpenJPEG in jp2-load
Status: RESOLVED OBSOLETE
Product: GEGL
Classification: Other
Component: operations
git master
Other All
: Normal enhancement
: ---
Assigned To: Default Gegl Component Owner
Default Gegl Component Owner
: 776033 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-04-07 18:27 UTC by Martin Blanchard
Modified: 2018-05-22 12:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Martin Blanchard 2016-04-07 18:27:08 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.
Comment 1 Michael Natterer 2016-04-07 18:42:36 UTC
Good idea, do you have a patch?
Comment 2 Martin Blanchard 2016-04-07 23:12:18 UTC
This is a work in progress, my branch is here:

https://gitlab.com/tchaik/gegl/commits/tchaik/wip/jp2
Comment 3 Martin Blanchard 2016-06-03 19:26:48 UTC
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
Comment 4 Michael Schumacher 2017-05-15 13:51:46 UTC
*** Bug 776033 has been marked as a duplicate of this bug. ***
Comment 5 Bastien Nocera 2017-05-15 19:00:53 UTC
(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.
Comment 6 GNOME Infrastructure Team 2018-05-22 12:13:39 UTC
-- 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.