Skip to main content

Error using Mosaic

5 replies [Last post]
maule
Offline
Joined: 2006-08-22

Hi i'm developing GIS software using JAI; I'm tring to use mosaic operator. When I apply it to 8 bit TIFFs or GIF it works; when I try to mosaic 24bit TIFF I got an error!

Here is a simple code fragments:

public class eJAITest {

public static void main(String[] args) {
Vector images = new Vector();

//load images
FileSeekableStream stream1, stream2;
try {
stream1 = new FileSeekableStream("D:\\MLenzi\\eImageServer\\Immagini\\Immagine11.tif");
stream2 = new FileSeekableStream("D:\\MLenzi\\eImageServer\\Immagini\\Immagine12.tif");
images.add(JAI.create("stream", stream1));
images.add(JAI.create("stream", stream2));
} catch (IOException e) {
e.printStackTrace();
System.exit(0);
}

ParameterBlock mosParams = new ParameterBlock();
mosParams.add(MosaicDescriptor.MOSAIC_TYPE_OVERLAY);
mosParams.setSources(images);

PlanarImage finalImage = JAI.create("mosaic", mosParams);

ScrollingImagePanel panel = new ScrollingImagePanel(finalImage, finalImage.getWidth(), finalImage.getHeight());

/* Create a frame to contain the panel. */
Frame window = new Frame("JAI Mosaic Test");
window.add(panel);
window.pack();
window.show();

}
}

Please note that I tested it with MOSAIC_TYPE_OVERLAY and MOSAIC_TYPE_BLEND. The returned error is:

java.lang.UnsatisfiedLinkError: void com.sun.medialib.mlib.Image.Thresh1(com.sun.medialib.mlib.mediaLibImage, com.sun.medialib.mlib.mediaLibImage, int[], int[], int[])

at com.sun.medialib.mlib.Image.Thresh1(Native Method)

at com.sun.media.jai.mlib.MlibMosaicOpImage.getWeightImage(MlibMosaicOpImage.java:340)

at com.sun.media.jai.mlib.MlibMosaicOpImage.computeRect(MlibMosaicOpImage.java:189)

at com.sun.media.jai.opimage.MosaicOpImage.computeTile(MosaicOpImage.java:456)

Regards.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
James Cheng

Hi Mauro,

I tested with your code (after adding some imports and changing the file
paths), 24-bit TIFF images, and both JAI 1.1.2_01 and JAI 1.1.3-alpha on
WinNT, but didn't see any problem. BTW, JAI 1.1.2_01 is almost the same
as 1.1.2.

Can you try to test it on another machine with a fresh installation of
JAI 1.1.2_01 or JAI 1.1.3-alpha? Or reinstall JAI on the same machine
after removing all those files listed below.

Thanks,
-James

On 06/30/05 05:52 AM, jai-interest@javadesktop.org wrote:
> I had a previous version of JAI, but I searched for old version of this files:
>
> jai_codec.jar
> jai_core.jar
> mlibwrapper_jai.jar
> mlib_jai.dll
> mlib_jai_mmx.dll
> checkmmx.exe
>
> and deleted them: now in my PC I have only the 1.1.2 version, but the problem persist.
>
> To try to reproduce my error, you can test the code I sent in my previous message:
> - if images1 and images2 are .gif or 8bit tif, it works;
> - if images1 and images 2 are 24bit tif or jpg, I get the exception.
> ---
> [Message sent by forum member 'maule' (Mauro Lenzi)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=96367&#96367

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

maule
Offline
Joined: 2006-08-22

Thank James for your tests.

Here is the solution of my problem: we are using JDeveloper Version 9.0.5.2 (build 1618). In the Project Properties -> Profiles -> Development -> Runner
I changed virtual machine from "ojvm" to "client" and now JAI works without errors.

It seems that ojvm has some problems when working with JAI...

Regards

James Cheng

Hi Mauro,

> Please note that I tested it with MOSAIC_TYPE_OVERLAY and MOSAIC_TYPE_BLEND. The returned error is:
>
> java.lang.UnsatisfiedLinkError: void com.sun.medialib.mlib.Image.Thresh1(com.sun.medialib.mlib.mediaLibImage, com.sun.medialib.mlib.mediaLibImage, int[], int[], int[])
>
> at com.sun.medialib.mlib.Image.Thresh1(Native Method)

I looks like there is a mismatch between the Java code and the native code.
Could you lease search your file system to see if you have an older version
of JAI which hasn't been removed completely?

Or, you can search for "UnsatisfiedLinkError" at:
http://archives.java.sun.com/cgi-bin/wa?A0=jai-interest&D=0&I=-3

If you still cannot fix the problem after making sure that you have just one
version of JAI installed, please provide a self-contained test case for us
to debug.

Thanks,
-James

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

maule
Offline
Joined: 2006-08-22

I had a previous version of JAI, but I searched for old version of this files:

jai_codec.jar
jai_core.jar
mlibwrapper_jai.jar
mlib_jai.dll
mlib_jai_mmx.dll
checkmmx.exe

and deleted them: now in my PC I have only the 1.1.2 version, but the problem persist.

To try to reproduce my error, you can test the code I sent in my previous message:
- if images1 and images2 are .gif or 8bit tif, it works;
- if images1 and images 2 are 24bit tif or jpg, I get the exception.

Brian Burkhalter

Please resubmit a self-contained test case that requires no editing, not even
of the file path.

Thanks,

Brian

On Thu, 30 Jun 2005 jai-interest@javadesktop.org wrote:

> I had a previous version of JAI, but I searched for old version of this files:
>
> jai_codec.jar
> jai_core.jar
> mlibwrapper_jai.jar
> mlib_jai.dll
> mlib_jai_mmx.dll
> checkmmx.exe
>
> and deleted them: now in my PC I have only the 1.1.2 version, but the problem persist.
>
> To try to reproduce my error, you can test the code I sent in my previous message:
> - if images1 and images2 are .gif or 8bit tif, it works;
> - if images1 and images 2 are 24bit tif or jpg, I get the exception.
> ---
> [Message sent by forum member 'maule' (Mauro Lenzi)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=96367&#96367
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

----------------
Brian Burkhalter
Advanced Development/Media & Entertainment
Market Development Engineering
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net