Bug 27839 - BufferedImage.TYPE_INT_BGR not supported
Summary: BufferedImage.TYPE_INT_BGR not supported
Alias: None
Product: classpath
Classification: Unclassified
Component: awt (show other bugs)
Version: 0.92
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2006-05-31 12:54 UTC by Norman Hendrich
Modified: 2006-12-01 15:46 UTC (History)
1 user (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:

testcase using BufferedImage.TYPE_INT_BGR (3.23 KB, text/plain)
2006-05-31 13:00 UTC, Norman Hendrich

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Hendrich 2006-05-31 12:54:53 UTC
See attached testcase for a class that tries to use BufferedImage with
TYPE_INT_BGR, because this way it was easier to convert the original C-style
data to actual image data for Java painting.

Exception during event dispatch:
java.lang.UnsupportedOperationException: FIXME: Programmer is confused. Why (and how) does a TYPE_INT_BGR image use ComponentColorModel to store 8-bit values? Is data type TYPE_INT or TYPE_BYTE. What is the difference between TYPE_INT_BGR and TYPE_3BYTE_BGR?
   at java.awt.image.BufferedImage.<init>(BufferedImage.java:160)

I looked at the source for BufferedImage.java, and I guess it is sufficient 
to just remove the FIXME and fall through to the case for TYPE_3BYTE_BGR, 
and add another case to set the bits3 mask.

I tried that, but the application then segfaults under jamvm trying to
dereference a null array. However, the same segfault occurs when I change
my testcase to use TYPE_3BYTE_BGR or TYPE_4BYTE_BGR - see next bug report.

- Norman
Comment 1 Norman Hendrich 2006-05-31 13:00:14 UTC
Created attachment 11552 [details]
testcase using BufferedImage.TYPE_INT_BGR
Comment 2 Norman Hendrich 2006-05-31 13:16:27 UTC
After actually reading my ancient code, it seems that I don't really need to 
use TYPE_BGR at all... Still, it would be nice if *BGR ordering would work in
Comment 3 Francis Kung 2006-12-01 15:46:30 UTC
Sven did this a few months ago