It seems to me that before set TYPE_INT_BGR image as
destination, it worth to check whether image reader
is able to use it.

Please take a look to the setDestioantion method
description: at the time of reading, the destination
image is checked to verify that its ColorModel and
SampleModel  correspond to one of the ImageTypeSpecifiers
returned from the ImageReader's getImageTypes method.
If it does not, the reader will throw an IIOException.

According to this, only image form list of supported image
types can be used as reading destination.

Of course, current behavior of  BMPImageReader is wrong
(actually, BMP reader works in assumption that destination
image is created according to structure of decoded image).
However, the fix could be just some verification of
destination image type and throwing an IIOException if
destination image does not correspond to one of supported
image types.

Thanks,
Andrew.
[Message sent by forum member 'bae' (bae)]

http://forums.java.net/jive/thread.jspa?messageID=118591

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to