Skip to main content

RE: [JAI-IMAGEIO] Trying to display tiled JPEG2000 images from server

3 replies [Last post]
Anonymous

Try creating a J2KImageReadParam and setting the decode region.
Then pass it into the ImageRead operator through the ParameterBlock.

> -----Original Message-----
> From: jai-imageio@javadesktop.org
> [mailto:jai-imageio@javadesktop.org]
> Sent: Monday, February 06, 2006 2:47 AM
> To: interest@jai-imageio.dev.java.net
> Subject: [JAI-IMAGEIO] Trying to display tiled JPEG2000
> images from server
>
>
> Hi,
>
> I am trying to display JPEG2000 tiled images from server. I
> have encoded Image with JJ2000 with tile size 128*128. fol is
> the code and error i am getting.it shows only one tile and
> then throws thease exception. I couldn't figure out what is
> the problem PLZ someone help me
>
> public void init()
> {
> try{
> this.setSize(1700,1000);
> RemoteJAI rc = new RemoteJAI("jairmi",null);
> ParameterBlock pb =new ParameterBlock();
> pb.add("c:\\alone8bit.jp2"); pb.add(0);
> pb.add(Boolean.FALSE); pb.add(Boolean.FALSE);
> pb.add(Boolean.FALSE); pb.add(null); pb.add(null);
> pb.add(null); rc.getServerCapabilities(); image =
> rc.create("ImageRead",pb,null);
>
>
>
> }catch(Exception exception)
> {
> System.out.println(exception.getMessage());
> }
> }
>
> public void paint(Graphics g)
> {
> Graphics2D g2 =(Graphics2D)g;
>
> g2.drawRenderedImage(image, new AffineTransform());
> }
>
>
>
>
>
>
>
>
>
>
>
> Exception in thread "AWT-EventQueue-1"
> java.lang.IllegalArgumentException: The destination or source
> region is empty. at
> com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader.comp
> uteRegionsWrapper(Unknown Source) at
> com.sun.media.imageioimpl.plugins.jpeg2000.J2KRenderedImageCod
> ecLib.(Unknown Source) at
> com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodec
> Lib.read(Unknown Source) at
> com.sun.media.jai.imageioimpl.ImageReadOpImage.computeTile(Unk
> nown Source) at
> com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileSc
> heduler.java:912)
> at javax.media.jai.OpImage.getTile(OpImage.java:1139)
> at javax.media.jai.RenderedOp.getTile(RenderedOp.java:2268)
> at
> com.sun.media.jai.rmi.JAIRMIImageServer.getCompressedTile(JAIR
> MIImageServer.java:498)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
> at sun.rmi.transport.Transport$1.run(Transport.java:153)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport
> .java:460)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTr
> ansport.java:701)
> at java.lang.Thread.run(Thread.java:595)
> at
> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer
> (StreamRemoteCall.java:247)
> at
> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCal
> l.java:223)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> at
> com.sun.media.jai.rmi.JAIRMIImageServer_Stub.getCompressedTile
> (Unknown Source) at
> com.sun.media.jai.rmi.RMIServerProxy.computeTile(RMIServerProx
> y.java:926)
> at
> javax.media.jai.remote.PlanarImageServerProxy.getTile(PlanarIm
> ageServerProxy.java:795)
> at javax.media.jai.RenderedOp.getTile(RenderedOp.java:2268)
> at
> sun.java2d.SunGraphics2D.drawTranslatedRenderedImage(SunGraphi
> cs2D.java:2542)
> at sun.java2d.SunGraphics2D.drawRenderedImage(SunGraphics2D.java:2429)
> at jaitest.RMITest.paint(RMITest.java:64)
> at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
> at sun.awt.RepaintArea.paint(RepaintArea.java:224)
> at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:254)
> at java.awt.Component.dispatchEventImpl(Component.java:4031)
> at java.awt.Container.dispatchEventImpl(Container.java:2024)
> at java.awt.Component.dispatchEvent(Component.java:3803)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
> at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDis
> patchThread.java:242)
> at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispa
> tchThread.java:163)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
> [Message sent by forum member 'deepu_31581' (deepu_31581)]
>
> http://forums.java.net/jive/thread.jspa?messageID=79249
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail:
> interest-help@jai-imageio.dev.java.net
>
>

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

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
deepu_31581
Offline
Joined: 2006-01-27
Points: 0

Now I have serialized J2KImageReadParam class and have used it to set the decode region of tiled image but still same exceptions are appearing

Do i need to do any extra settings for tile codec? or anything else for RemoteJAI coz thease tiled images can be comfortably displayed from local location

deepu_31581
Offline
Joined: 2006-01-27
Points: 0

J2KImageReadParam is not serializable hence i cannot pass it to the server

Brian Burkhalter

Please file an enhancement request at jai-imageio-core.dev.java.net to make it
serializable, if that is even possible.

Brian

On Tue, 7 Feb 2006, jai-imageio@javadesktop.org wrote:

> J2KImageReadParam is not serializable hence i cannot pass it to the server
> [Message sent by forum member 'deepu_31581' (deepu_31581)]
>
> http://forums.java.net/jive/thread.jspa?messageID=79713
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
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-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net