ImageMagick-6.8.8-10 is not compatible with OpenJPEG-2.0.0

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
ssuominengentoo
Posts: 5
Joined: 2014-04-06T05:01:28-07:00
Authentication code: 6789

ImageMagick-6.8.8-10 is not compatible with OpenJPEG-2.0.0

Post by ssuominengentoo »

function opj_stream_destroy_v3() doesn't exist in the latest OpenJPEG-2.0.0 release, only opj_stream_destroy() does
while it compiles, it renders the jpeg2k support useless

this was reported at http://bugs.gentoo.org/503692 by Alexander Miller

The opj_stream_destroy_v3() function was added to the API in revision r2293 on 2013-02-03
and is not present in openjpeg-2.0.0 (released in 2012-11)

Code: Select all

--- coders/jp2.c
+++ coders/jp2.c
@@ -369,7 +369,7 @@ static Image *ReadJP2Image(const ImageIn
   if (opj_read_header(jp2_stream,jp2_codec,&jp2_image) == 0)
     {
       opj_stream_set_user_data(jp2_stream,NULL);
-      opj_stream_destroy_v3(jp2_stream);
+      opj_stream_destroy(jp2_stream);
       opj_destroy_codec(jp2_codec);
       ThrowReaderException(DelegateError,"UnableToDecodeImageFile");
     }
@@ -384,7 +384,7 @@ static Image *ReadJP2Image(const ImageIn
       if (jp2_status == 0)
         {
           opj_stream_set_user_data(jp2_stream,NULL);
-          opj_stream_destroy_v3(jp2_stream);
+          opj_stream_destroy(jp2_stream);
           opj_destroy_codec(jp2_codec);
           opj_image_destroy(jp2_image);
           ThrowReaderException(DelegateError,"UnableToDecodeImageFile");
@@ -402,13 +402,13 @@ static Image *ReadJP2Image(const ImageIn
   if (jp2_status == 0)
     {
       opj_stream_set_user_data(jp2_stream,NULL);
-      opj_stream_destroy_v3(jp2_stream);
+      opj_stream_destroy(jp2_stream);
       opj_destroy_codec(jp2_codec);
       opj_image_destroy(jp2_image);
       ThrowReaderException(DelegateError,"UnableToDecodeImageFile");
     }
   opj_stream_set_user_data(jp2_stream,NULL);
-  opj_stream_destroy_v3(jp2_stream);
+  opj_stream_destroy(jp2_stream);
   for (i=0; i < (ssize_t) jp2_image->numcomps; i++)
   {
     if ((jp2_image->comps[i].dx == 0) || (jp2_image->comps[i].dy == 0))
@@ -1057,7 +1057,7 @@ static MagickBooleanType WriteJP2Image(c
       (opj_end_compress(jp2_codec,jp2_stream) == 0))
     {
       opj_stream_set_user_data(jp2_stream,NULL);
-      opj_stream_destroy_v3(jp2_stream);
+      opj_stream_destroy(jp2_stream);
       opj_destroy_codec(jp2_codec);
       opj_image_destroy(jp2_image);
       ThrowWriterException(DelegateError,"UnableToEncodeImageFile");
@@ -1066,7 +1066,7 @@ static MagickBooleanType WriteJP2Image(c
     Free resources.
   */
   opj_stream_set_user_data(jp2_stream,NULL);
-  opj_stream_destroy_v3(jp2_stream);
+  opj_stream_destroy(jp2_stream);
   opj_destroy_codec(jp2_codec);
   opj_image_destroy(jp2_image);
   (void) CloseBlob(image);
ssuominengentoo
Posts: 5
Joined: 2014-04-06T05:01:28-07:00
Authentication code: 6789

Re: ImageMagick-6.8.8-10 is not compatible with OpenJPEG-2.0

Post by ssuominengentoo »

Link to the patch for easy fetching:

http://sources.gentoo.org/cgi-bin/viewv ... h?view=log
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick-6.8.8-10 is not compatible with OpenJPEG-2.0

Post by magick »

Patch applied to Subversion trunk. Thanks.
Post Reply