summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2001-06-06 09:58:22 +0000
committerWez Furlong <wez@php.net>2001-06-06 09:58:22 +0000
commit94ea334dce77e7a711e298313585c254c8487216 (patch)
treec468f3007c4c102810c760f1526da61d9fa602ac
parentc3106f4c3e89642d78e785fdb11e720b7937c897 (diff)
downloadphp-git-94ea334dce77e7a711e298313585c254c8487216.tar.gz
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!
-rw-r--r--ext/pdf/pdf.c6
1 files 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);