kinow commented on a change in pull request #106:
URL: https://github.com/apache/commons-imaging/pull/106#discussion_r522538722
##########
File path: src/main/java/org/apache/commons/imaging/common/ImageBuilder.java
##########
@@ -242,16 +266,29 @@ private BufferedImage makeBufferedImage(
WritableRaster raster;
final DataBufferInt buffer = new DataBufferInt(argb, w * h);
if (useAlpha) {
- colorModel = new DirectColorModel(32, 0x00ff0000, 0x0000ff00,
- 0x000000ff, 0xff000000);
- raster = Raster.createPackedRaster(buffer, w, h,
- w, new int[]{0x00ff0000, 0x0000ff00, 0x000000ff,
- 0xff000000}, null);
+ colorModel = new DirectColorModel(
+ ColorSpace.getInstance(ColorSpace.CS_sRGB),
Review comment:
If a company like Microsoft, Google, Facebook, etc, invested some money
and time in organising all the image standards into a single, uniform website,
like JavaScript MDN, W3C specs, etc, that would make writing libraries like
Common Imaging much easier (and more sane :laughing: ).
Thanks for looking into this. Looks like we are good staying up close with
what the JDK does, unless a user has a valid case for us using another type.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]