From f4bc5ad4c3d3f341444023f0659dc4434c7198cc Mon Sep 17 00:00:00 2001 From: james Date: Fri, 21 Jan 2005 17:01:43 +0000 Subject: [PATCH] only close the image if was opened to begin with --- lpdf.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lpdf.php b/lpdf.php index b6e31b0..5c8745c 100644 --- a/lpdf.php +++ b/lpdf.php @@ -306,7 +306,11 @@ class lpdf function output() { pdf_end_page($this->pdf); - pdf_close_image($this->pdf,$this->logoimage); + + //only close the image if it was opened to begin with + if($this->logoimage) + pdf_close_image($this->pdf,$this->logoimage); + pdf_close($this->pdf); $pdfdata=pdf_get_buffer($this->pdf); header("Content-type: application/pdf");