From 94ea334dce77e7a711e298313585c254c8487216 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 6 Jun 2001 09:58:22 +0000 Subject: [PATCH] Prevent problems with PDFlib 3.00 when setting the imagewarning parameter. # I don't know if this is in later minors of PDF 3.x; someone please check! --- ext/pdf/pdf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c index 5599a38705..ae80bf51b1 100644 --- a/ext/pdf/pdf.c +++ b/ext/pdf/pdf.c @@ -60,7 +60,6 @@ static int le_gd; static int le_pdf; /* {{{ constants -/* * to adopt the php way of error handling to PDFlib * The image related functions in PDFlib return -1 on error * but they may return 0 (FALSE) in normal cases @@ -487,8 +486,9 @@ PHP_FUNCTION(pdf_open) } else { PDF_open_mem(pdf, pdf_flushwrite); } - +#if (PDFLIB_MAJORVERSION >= 4) PDF_set_parameter(pdf, "imagewarning", "true"); +#endif PDF_set_parameter(pdf, "binding", "PHP"); ZEND_REGISTER_RESOURCE(return_value, pdf, le_pdf); @@ -2226,7 +2226,9 @@ PHP_FUNCTION(pdf_new) { PDF *pdf; pdf = PDF_new2(custom_errorhandler, pdf_emalloc, pdf_realloc, pdf_efree, NULL); +#if (PDFLIB_MAJORVERSION >= 4) PDF_set_parameter(pdf, "imagewarning", "true"); +#endif PDF_set_parameter(pdf, "binding", "PHP"); ZEND_REGISTER_RESOURCE(return_value, pdf, le_pdf); -- 2.50.1