]> granicus.if.org Git - php/commitdiff
Prevent problems with PDFlib 3.00 when setting the imagewarning parameter.
authorWez Furlong <wez@php.net>
Wed, 6 Jun 2001 09:58:22 +0000 (09:58 +0000)
committerWez Furlong <wez@php.net>
Wed, 6 Jun 2001 09:58:22 +0000 (09:58 +0000)
# I don't know if this is in later minors of PDF 3.x; someone please check!

ext/pdf/pdf.c

index 5599a387052d6ebbbb8b6850587e8448354f3f5d..ae80bf51b10eb0c51b7acd8369ba53ad67611676 100644 (file)
@@ -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);