BufferedImage drawing bug

Jan Maslik <[email protected]> Tue, 13 Oct 2015 05:13:51 +0200
Newsgroups gmane.comp.java.lib.itext.general
Message-ID <CAPLS01g4zq23WKUFQESsSpHz556J1dREN8v6VsB2R-fNKEBm1Q@mail.gmail.com>
--===============2570002095375013859==
Content-Type: multipart/alternative; boundary=089e01493bd0d0af490521f3d56c

--089e01493bd0d0af490521f3d56c
Content-Type: text/plain; charset=UTF-8

Hello,
i would like to report bug of itext library.
iText has wrong interpretation of drawed image into pdf if image has
transparent pixel (argb value = 0 ) .
Image is correct only in case transparent pixels has values (argb =
 0xFFFFFF ).
If i save "my" image into png by ImageIO /ImageMagick/PngEncoder , it shows
correctly .

Pasting my wrapped workarround which fixed the issue in case you dont
understand because my english skill.

                               BufferedImage img = ...

                               RgbIterator pixIterator =
FastRGB.getIterator(img);

for(int i = 0 ; i < pixIterator.size() ; i++ )
{
if( pixIterator.isTransparent(i) )
{
pixIterator.setARGB(i, 0xFFFFFF );
}
}

--089e01493bd0d0af490521f3d56c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello,<div>i would like to report bug of itext library.</d=
iv><div>iText has wrong interpretation of drawed image into pdf if image ha=
s transparent pixel (argb value =3D 0 ) .=C2=A0</div><div>Image is correct =
only in case transparent pixels has values (argb =3D =C2=A00xFFFFFF ).</div=
><div>If i save &quot;my&quot; image into png by ImageIO /ImageMagick/PngEn=
coder , it shows correctly .=C2=A0</div><div><br></div><div>Pasting my wrap=
ped workarround which fixed the issue in case you dont understand because m=
y english skill.</div><div><br></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0BufferedImage img =3D ...</div><div>=C2=A0=C2=A0</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0RgbIterator pixIterator =3D FastRGB.getIterator(=
img);<br></div><div><br></div><div><span class=3D"" style=3D"white-space:pr=
e">				</span>for(int i =3D 0 ; i &lt; pixIterator.size() ; i++ )</div><div=
><span class=3D"" style=3D"white-space:pre">				</span>{</div><div><span cl=
ass=3D"" style=3D"white-space:pre">					</span>if( pixIterator.isTransparen=
t(i) )</div><div><span class=3D"" style=3D"white-space:pre">					</span>{</=
div><div><span class=3D"" style=3D"white-space:pre">						</span>pixIterato=
r.setARGB(i, 0xFFFFFF );<span class=3D"" style=3D"white-space:pre">	</span>=
</div><div><span class=3D"" style=3D"white-space:pre">					</span>}</div><d=
iv><span class=3D"" style=3D"white-space:pre">				</span>}</div></div>

--089e01493bd0d0af490521f3d56c--


--===============2570002095375013859==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------

--===============2570002095375013859==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
--===============2570002095375013859==--