summaryrefslogtreecommitdiff
path: root/pdf-over-commons/src
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-08 15:37:38 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-08 15:37:38 +0200
commit0dad4e12976720ef16de28cbd54086ef652ab2ec (patch)
tree5529527110923a0df8efeaf053f3a2b7da141e71 /pdf-over-commons/src
parentedcabbd3f6b9fc7d4697257d4f9c2e18dc7c9534 (diff)
downloadpdf-over-0dad4e12976720ef16de28cbd54086ef652ab2ec.tar.gz
pdf-over-0dad4e12976720ef16de28cbd54086ef652ab2ec.tar.bz2
pdf-over-0dad4e12976720ef16de28cbd54086ef652ab2ec.zip
fix transparent pixel handling in AWT -> SWT image converter, cf. #109
Diffstat (limited to 'pdf-over-commons/src')
-rw-r--r--pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java
index 08adb0f2..b3687022 100644
--- a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java
+++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java
@@ -246,6 +246,8 @@ public final class ImageUtil {
raster.getPixel(x, y, pixelArray);
int pixel = palette.getPixel(new RGB(pixelArray[0], pixelArray[1], pixelArray[2]));
data.setPixel(x, y, pixel);
+ if (3 < pixelArray.length)
+ data.setAlpha(x, y, pixelArray[3]);
}
}
return data;