OpenJPEGJavaDecoder constructor

100 views
Skip to first unread message

Dan

unread,
May 24, 2012, 4:05:09 PM5/24/12
to OpenJPEG
First of all I am glad to see OpenJPEG decodes JPEG2000 with Region of
Interest sections and converts to the requested output format from the
command line. The Java Advanced Imaging and Java Image I/O libraries
would not handle the compressed area. Now I am trying to use the
OpenJPEG functionality from Java. My question is what filename needs
to be specified to the constructor for "OpenJPEGJavaDecoder"? The
only ".dll" that was built is listed below. That and other variations
yield "OpenJPEG Java Decoder: probably impossible to find the C
library".

String openJPEGFilename = "c:/Users/dan/Downloads/openjpeg/
openjpeg-read-only/build/libopenjpeg/.libs/cygopenjpeg-1.dll";
File openJPEGFile = new File(openJPEGFilename);
if (!openJPEGFile.exists())
{
throw new IOException("The open jpeg file " + openJPEGFilename +
" does not exist.");
} // if

openJPEGJavaDecoder = new OpenJPEGJavaDecoder(openJPEGFilename);

Thanks,
dan

Mathieu Malaterre

unread,
May 25, 2012, 3:03:35 AM5/25/12
to open...@googlegroups.com
On Thu, May 24, 2012 at 10:05 PM, Dan <ruby.des...@gmail.com> wrote:
> First of all I am glad to see OpenJPEG decodes JPEG2000 with Region of
> Interest sections and converts to the requested output format from the
> command line.  The Java Advanced Imaging and Java Image I/O libraries
> would not handle the compressed area.  Now I am trying to use the
> OpenJPEG functionality from Java.  My question is what filename needs
> to be specified to the constructor for "OpenJPEGJavaDecoder"?  The
> only ".dll" that was built is listed below.  That and other variations
> yield "OpenJPEG Java Decoder: probably impossible to find the C
> library".
>
>    String openJPEGFilename = "c:/Users/dan/Downloads/openjpeg/
> openjpeg-read-only/build/libopenjpeg/.libs/cygopenjpeg-1.dll";

This look like a very odd path. Try a 'make install' step to make sure
everything is installed properly.

>    File openJPEGFile = new File(openJPEGFilename);
>    if (!openJPEGFile.exists())
>    {
>        throw new IOException("The open jpeg file " + openJPEGFilename +
> " does not exist.");
>    } // if
>
>    openJPEGJavaDecoder = new OpenJPEGJavaDecoder(openJPEGFilename);

Well I guess the path to the lib is ok. So the only other reason why
.load() would fail is that it does not find dependend libraries. Use
depends (dependecy walker) to make sure all dll can be resolved at
runtime.

HTH
--
Mathieu

Dan

unread,
May 29, 2012, 11:51:54 AM5/29/12
to OpenJPEG
It does help. The "make install" ran without errors. The original
build steps worked fine also after downloading the needed cygwin
components.

The dependency walker sure helped. It pointed out that "CYGWIN1.DLL"
and "CYGOPENJPEG-1.DLL" are both x86 on the PC and the other DLLs it
associated with it are all x64 on the Windows 7 Enterprise system
which is being used for development. The target OS is Solaris so this
may need to be revisited there.

Thanks,
dan

On May 25, 2:03 am, Mathieu Malaterre <mathieu.malate...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages