Php – TCPDF: PNG image rendered incorrectly

pdfPHPpngtcpdf

I'm working on a project which involves TCPDF. I've been working with it for a while now but, after the last update (6.0) my PNG images get really broken although its fragments still visible on the document.

I'm using the Image() method as follows:
$pdf->Image($img, $x, $y, $twidth, $theight);

where $img is the source URL, $x and $y the position and $twidth and $theight the size.
I've tested GIF and JPG and it works just fine. There is a GIF image on the PDF to prove that. The PNG image is the VLC icon logo.

The image:

enter image description here

Best Answer

From the project site, to a user who had a similar problem:

Probably you have problems with PNG images with transparency that are handled in different way depending on the php-imagick or php-gd version used. Try to update php-imagick and disable php-gd

Related Topic