Skip to content

Commit

Permalink
Cherry-pick from BTEUK: use java.awt.image instead of sun.awt.image
Browse files Browse the repository at this point in the history
  • Loading branch information
LM-Wolfert authored and SmylerMC committed Jan 4, 2025
1 parent 31a707c commit 4e16ae6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {

compileJava {
sourceCompatibility = targetCompatibility = "17"
options.compilerArgs << '--add-exports=java.desktop/sun.awt.image=ALL-UNNAMED'
}

version = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim().replace("/", "-") + "-SNAPSHOT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import org.apache.commons.imaging.formats.tiff.constants.TiffConstants;
import org.apache.commons.imaging.formats.tiff.constants.TiffTagConstants;
import org.apache.commons.imaging.formats.tiff.photometricinterpreters.PhotometricInterpreter;
import sun.awt.image.IntegerComponentRaster;

import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt;
import java.io.IOException;
import java.util.Collections;

Expand Down Expand Up @@ -144,7 +144,7 @@ public boolean isRaw() {
throw new IllegalArgumentException("unsupported sample format: " + sampleFormat);
}

int[] src = ((IntegerComponentRaster) img.getRaster()).getDataStorage();
int[] src = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
checkArg(src.length == dst.length, "data length invalid?!?");
for (int i = 0; i < dst.length; i++) {
dst[i] = (src[i] & mask) << shift >> shift;
Expand Down

0 comments on commit 4e16ae6

Please sign in to comment.