Skip to main content

PlanarImage.getAsBufferedImage corrupts the image!!! Am I wrong?

4 replies [Last post]
oasiszjj
Offline
Joined: 2005-11-08
Points: 0

HI, all,

I simplly test the getAsBufferedImage function of PlanarImage clas.

1. PlanarImage im = "load image file using JAI"
// Then call a graphic2D panel to render the bufferedImage uisng:
2. displayIm(im.getAsBufferedImage()); The image is OK
then
3. BufferedImage bufferedImage = im.getAsBufferedImage();
4. Then again call:
displayIm(bufferedImage); The image is corrupt and different.

Does sb. have an idea?

Thanks.

Reply viewing options

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

Never heard of this before. Can you supply a self-contained test case
demonstrating the alleged problem?

Brian

On Wed, 16 Nov 2005, jai-interest@javadesktop.org wrote:

> HI, all,
>
> I simplly test the getAsBufferedImage function of PlanarImage clas.
>
> 1. PlanarImage im = "load image file using JAI"
> // Then call a graphic2D panel to render the bufferedImage uisng:
> 2. displayIm(im.getAsBufferedImage()); The image is OK
> then
> 3. BufferedImage bufferedImage = im.getAsBufferedImage();
> 4. Then again call:
> displayIm(bufferedImage); The image is corrupt and different.
>
> Does sb. have an idea?
>
> Thanks.
> ---
> [Message sent by forum member 'oasiszjj' (oasiszjj)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=125377&#125377
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

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

oasiszjj
Offline
Joined: 2005-11-08
Points: 0

I tested it again. Find that:

1. If I load the image file and then call
BufferedImage bm = im. getAsBufferedImage();
display(bm);
It is OK.
2. But if I pass the im to a function defined in another class, namely operation. And do the same thing, the image corrupts.
Call funtion: doFunction(im).
and then in the function do:
BufferedImage bm = im. getAsBufferedImage();
display(bm);
The image corrupts.

Brian Burkhalter

Please re-read this message:

https://jai.dev.java.net/servlets/ReadMsg?list=interest&msgNo=1277

On Wed, 16 Nov 2005, jai-interest@javadesktop.org wrote:

> I tested it again. Find that:
>
> 1. If I load the image file and then call
> BufferedImage bm = im. getAsBufferedImage();
> display(bm);
> It is OK.
> 2. But if I pass the im to a function defined in another class, namely operation. And do the same thing, the image corrupts.
> Call funtion: doFunction(im).
> and then in the function do:
> BufferedImage bm = im. getAsBufferedImage();
> display(bm);
> The image corrupts.
> ---
> [Message sent by forum member 'oasiszjj' (oasiszjj)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=125537&#125537
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

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

oasiszjj
Offline
Joined: 2005-11-08
Points: 0

Hi,

The program is Ok now. I wrongly signed the variable as a global, thus in the next function I changed it. So, the displayed one is not the one I expected.

Thanks very much for your repies.

Best.