diff --git a/fine-itext-old/src/main/java/com/fr/third/com/lowagie/text/Image.java b/fine-itext-old/src/main/java/com/fr/third/com/lowagie/text/Image.java index 515160b54..4e534db31 100644 --- a/fine-itext-old/src/main/java/com/fr/third/com/lowagie/text/Image.java +++ b/fine-itext-old/src/main/java/com/fr/third/com/lowagie/text/Image.java @@ -753,10 +753,6 @@ public abstract class Image extends Rectangle { } else if (transparency == null) { if (alpha == 0) { transparentPixel = pixels[j] & 0xffffff; - transparency = new int[6]; - transparency[0] = transparency[1] = (transparentPixel >> 16) & 0xff; - transparency[2] = transparency[3] = (transparentPixel >> 8) & 0xff; - transparency[4] = transparency[5] = transparentPixel & 0xff; // Added by Michael Klink // Check whether this value for transparent pixels // has already been used for a non-transparent one @@ -768,10 +764,15 @@ public abstract class Image extends Rectangle { // for transparency; we could still use an image // mask but for simplicity let's use a soft mask // which already is implemented here + // stackOverFlow:https://stackoverflow.com/questions/39119776/itext-binary-transparency-bug shades = true; break; } } + transparency = new int[6]; + transparency[0] = transparency[1] = (transparentPixel >> 16) & 0xff; + transparency[2] = transparency[3] = (transparentPixel >> 8) & 0xff; + transparency[4] = transparency[5] = transparentPixel & 0xff; } } else if (((pixels[j] & 0xffffff) != transparentPixel) && (alpha == 0)) { shades = true;