MacPorts +jpeg2 option broken

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
mowaca
Posts: 2
Joined: 2014-04-14T10:34:08-07:00
Authentication code: 6789

MacPorts +jpeg2 option broken

Post by mowaca »

This option doesn't appear to work anymore. I think this is related to the change from jasper to openjp2 - it refers to the --with-jp2 option in the config file which no longer does anything.

I also tried building from source but I can't figure out how to get the jp2 delegate installed --with-openjp2 doesn't appear to do anything unless you have --with-jp2 enabled. Help!

IM 6.8.9.0.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: MacPorts +jpeg2 option broken

Post by fmw42 »

You have to install OpenJPEG 2.0. Jasper has been replaced by OpenJPEG 2.0. Recompile IM. But I have had problems myself with the version of OpenJPEG 2 from MacPorts. It seems to use older file naming conventions, so IM cannot find the files. I am not sure if it is fixed in MacPorts, since I have not tried installing it again myself for some weeks. Let me know if you still have trouble after installing OpenJPEG 2.0 from MacPorts and reinstalling IM.

OpenJPEG has moved from libopenjpeg to libopenjp2 and libopenjpeg.pc to libopenjp2.pc.

See what files you have installed from MacPorts.
mowaca
Posts: 2
Joined: 2014-04-14T10:34:08-07:00
Authentication code: 6789

Re: MacPorts +jpeg2 option broken

Post by mowaca »

There's no port called libopenjp2,there's one called libopenjpeg, is that what you meant? I think you are suggesting compiling from source, I'll try that.

I want to clarify that the +jpeg2 option no longer working in macports is a bug - either fix it or remove the variant if its no longer supported.

* I actually went back to the ImageMagick-6.8.7-10_0 port, the +jpeg2 variant works there. Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: MacPorts +jpeg2 option broken

Post by fmw42 »

There's no port called libopenjp2,there's one called libopenjpeg, is that what you meant?
Yes, but be sure it is version 2.
ryandesign
Posts: 17
Joined: 2012-05-22T18:37:42-07:00
Authentication code: 13

Re: MacPorts +jpeg2 option broken

Post by ryandesign »

I am the maintainer of ImageMagick in MacPorts, but I was only informed of this problem today. If nobody reports problems to me, it's quite possible I won't know about the problem and therefore won't be working on fixing it, so please report MacPorts issues in the MacPorts issue tracker when you find them.
thorsted
Posts: 2
Joined: 2012-11-06T10:08:33-07:00
Authentication code: 67789

Re: MacPorts +jpeg2 option broken

Post by thorsted »

Even compiling from source with OpenJpeg 2.1 installed still is not recognized during configure. Seems a bit premature for ImageMagick to drop JasPer support before ensuring OpenJpeg is configured correctly. Thanks Ryan for working on the MacPorts solution.
ryandesign
Posts: 17
Joined: 2012-05-22T18:37:42-07:00
Authentication code: 13

Re: MacPorts +jpeg2 option broken

Post by ryandesign »

The MacPorts maintainer of openjpeg has updated it to version 2.1.0, which now supplies the pkg-config file ImageMagick expects to find, so it's detected fine. Unfortunately, it does not compile:

Code: Select all

coders/jp2.c:343:44: error: too few arguments to function call, expected 3, have 2
  opj_stream_set_user_data(jp2_stream,image);
  ~~~~~~~~~~~~~~~~~~~~~~~~                 ^
/opt/local/include/openjpeg-2.1/openjpeg.h:1154:1: note: 'opj_stream_set_user_data' declared here
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function);
^
/opt/local/include/openjpeg-2.1/openjpeg.h:82:20: note: expanded from macro 'OPJ_API'
#define OPJ_API    __attribute__ ((visibility ("default")))
                   ^
I think we now need ImageMagick developer assistance to resolve this.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: MacPorts +jpeg2 option broken

Post by magick »

OpenJP2 broke the API between 2.0.0 and 2.0.1. We can require a min release of 2.0.1 to get around this breakage. Look for a patch in ImageMagick 6.8.9-1 Beta later today.
ryandesign
Posts: 17
Joined: 2012-05-22T18:37:42-07:00
Authentication code: 13

Re: MacPorts +jpeg2 option broken

Post by ryandesign »

Thanks, 6.8.9-1 builds fine with jpeg2.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: MacPorts +jpeg2 option broken

Post by fmw42 »

Thanks from me, also. IM compiles fine from source using delegates (openjpeg 2.1.0 -- jp2) from MacPorts.
Post Reply