Menu

#1070 PNG regression in 6.2.9 (they appear as their alpha channel)

v1.0_(example)
closed
1
2015-08-02
2015-07-31
No

Hi,

Since version 6.2.9, PNG images with an alpha layers get replaced with the alpha layer.
This is related to the added $info = false; on line 7029.

I couldn't understood why this line was added, the proper info array was filled there … I tried to figure out what's going on - it seems the alpha layer gets added as a regular image over the processed png for some reason (there is no comment for that commit).

I've done some testing :

  • Same error wether imagick is enabled or not (tested with the old PHP 5.3.29)
  • The error doesn't occur if the next blocks are inverted (imagick first, then GD) - this may mean there is something odd going with transparency in the GD code … but I'm unsure (as I said, didn't figured out exactly what was going on in that area)
  • Commenting that line (as per 6.2.8) also fixes the issue - the next functions were never called.
  • I've done some speed testing by looping through the functions called after that line, to figure out why gd was before imagick (the test was on a full page PNG - I didn't tester other image formats) - here are the results, oddly gd was faster with the mask (maybe because something is going wrong there, as well) :
    [31-Jul-2015 13:08:40 Europe/Paris] imagick loop 1 ran for 3,72302007675 seconds on /var/tmp//__tcpdf_80200bf00c8c2fac20a094b8b5123884_imgmask_alpha_fdd919a478a64b50db7f2ccda97e9904
    [31-Jul-2015 13:08:51 Europe/Paris] imagick loop 2 ran for 11,3857560158 seconds on /var/tmp//__tcpdf_80200bf00c8c2fac20a094b8b5123884_imgmask_plain_fdd919a478a64b50db7f2ccda97e9904

    [31-Jul-2015 13:02:52 Europe/Paris] gd loop 1 ran for 1,00745797157 seconds on /var/tmp//__tcpdf_62d90cbc8ecaa3b7d40ee5b8a69b7b28_imgmask_alpha_fdd919a478a64b50db7f2ccda97e9904
    [31-Jul-2015 13:03:37 Europe/Paris] gd loop 2 ran for 45,2029230595 seconds on /var/tmp//__tcpdf_62d90cbc8ecaa3b7d40ee5b8a69b7b28_imgmask_plain_fdd919a478a64b50db7f2ccda97e9904

Hope that helps !

Thanks,
Mathieu

Discussion

  • Mathieu Masseboeuf

    Hum, seems a previous bug report already mentioned this (anyway, I have more informations here) : #1061

     
  • Nicola Asuni

    Nicola Asuni - 2015-08-02

    This should be fixed in TCPDF 6.2.11

     
  • Nicola Asuni

    Nicola Asuni - 2015-08-02
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB