Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3142,12 +3142,14 @@ public ImageData getImageData() {
if (!hasMaskData && depth == 32) {
alphaData = new byte[width * height];
boolean hasAlphaData = false;
boolean isAllZeroAlpha = true;
for (int pixelIndex = 0; pixelIndex < alphaData.length; pixelIndex++) {
alphaData[pixelIndex] = data[pixelIndex * 4 + 3];
hasAlphaData |= alphaData[pixelIndex] != -1;
isAllZeroAlpha &= alphaData[pixelIndex] == 0;
}
// In case there is alpha data, replace the empty mask data with proper alpha data
if (hasAlphaData) {
if (hasAlphaData && !isAllZeroAlpha) {
maskData = null;
} else {
alphaData = null;
Expand Down
Loading