raunakbinani / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

Urgent - dompdf 0.5.1 is not compatible with PHP 5.2.11! #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to compile a HTML document containing PNG images
2. Half way through a warning appears and compilation halts:

"imagecreatefrompng() [<a
href='function.imagecreatefrompng'>function.imagecreatefrompng</a>]:
'/tmp/dompdf_img_Ut5PV6' is not a valid PNG file"

Path: /dompdf/include/abstract_renderer.cls.php:155

What version of the product are you using? On what operating system?
0.5.1

Please provide any additional information below.
I have two servers, one running 5.2.10 and the other running 5.2.11. The
server running the latest version, I'm seeing header information being
added into the dompdf_img_ temporary image files, as follows:

HTTP/1.1 200 OK
Date: Sun, 20 Sep 2009 13:59:18 GMT
Server: Apache
Last-Modified: Fri, 18 Sep 2009 23:39:54 GMT
Accept-Ranges: bytes
Content-Length: 1778
Cache-Control: max-age=2592000
Expires: Tue, 20 Oct 2009 13:59:18 GMT
Connection: close
Content-Type: image/png

In PHP 5.2.10 however, this isn't occurring.

I have managed to replicate this issue with JPEG images too. Again, header
information is being added to the temporary JPEG file:

HTTP/1.1 200 OK
Date: Sun, 20 Sep 2009 14:07:31 GMT
Server: Apache
Last-Modified: Sun, 20 Sep 2009 14:07:21 GMT
Accept-Ranges: bytes
Content-Length: 1341
Cache-Control: max-age=2592000
Expires: Tue, 20 Oct 2009 14:07:31 GMT
Connection: close
Content-Type: image/jpeg

This is causing GD to freak out with:

"imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG
library reports unrecoverable error"

Path: /dompdf/include/abstract_renderer.cls.php:160

This needs fixing urgently as I am unable to upgrade to PHP 5.2.11, which
means we are no longer PCI compliant.

Let me know if you need anything more. I'll be happy to try anything you
need me to.

Original issue reported on code.google.com by read...@gmail.com on 20 Sep 2009 at 2:12

GoogleCodeExporter commented 9 years ago
Just to mention I'm using remote image URLs. In PHP 5.2.10 this works fine. 
While
working on the PHP 5.2.11 server I changed the remote URLs into local paths 
instead.

This seems to be working, but still not sure why remote image URLs is no longer
working in PHP 5.2.11?

Original comment by read...@gmail.com on 20 Sep 2009 at 2:31

GoogleCodeExporter commented 9 years ago
Just to add I have managed to replicate this issue in other scripts that 
utilise the
file_get_contents function, but using dompdf 0.5.1 with PHP 5.2.11 is still 
causing
problems. After downgrading to 5.2.10, dompdf runs as expected.

Original comment by read...@gmail.com on 20 Sep 2009 at 7:36

GoogleCodeExporter commented 9 years ago
Valid for users system, but does not appear to be a problem in DOMPDF.

Original comment by eclecticgeek on 23 Sep 2009 at 8:04

GoogleCodeExporter commented 9 years ago
For anyone who's interested this appears to be a bug within PHP 5.2.11. Some 
users
may experience problems especially with DOMPDF as it utilises the 
file_get_contents()
to convert images into temporary files, then back into images for the PDF 
compilation
process.

More details available here: http://bugs.php.net/49611

See attached file for patch (credits go to cPanel Dev "J.D.").

Original comment by read...@gmail.com on 26 Sep 2009 at 12:28

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:15