Skip to content

Commit

Permalink
Missed adding complete bogus colorspace creation code to else
Browse files Browse the repository at this point in the history
  • Loading branch information
iGN5117 committed Nov 14, 2023
1 parent 1a34444 commit 3e68c96
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,13 @@ public static GridCoverage2D create(WritableRaster raster, GridCoverage2D refere
GridGeometry2D gridGeometry = referenceRaster.getGridGeometry();
int numBand = raster.getNumBands();
int rasterDataType = raster.getDataBuffer().getDataType();

final ColorSpace cs = new BogusColorSpace(numBand);
final int[] nBits = new int[numBand];
Arrays.fill(nBits, DataBuffer.getDataTypeSize(rasterDataType));
ColorModel colorModel;
if (originalColorModel.isCompatibleRaster(raster)) {
colorModel = originalColorModel;
}else {
final ColorSpace cs = new BogusColorSpace(numBand);
final int[] nBits = new int[numBand];
Arrays.fill(nBits, DataBuffer.getDataTypeSize(rasterDataType));
colorModel = new ComponentColorModel(cs, nBits, false, true, Transparency.OPAQUE, rasterDataType);
}
if (noDataValue != null) {
Expand Down

0 comments on commit 3e68c96

Please sign in to comment.