[PHP-DEV] CVS update: php3/functions From: steinm (php-dev <email protected>)
Date: 06/30/99

Date: Wednesday June 30, 1999 @ 16:40
Author: steinm

Update of /repository/php3/functions
In directory php:/tmp/cvs-serv5924/functions

Modified Files:
        pdf.c
Log Message:
- several bug fixes concerning image inclusion

Index: php3/functions/pdf.c
diff -u php3/functions/pdf.c:1.34 php3/functions/pdf.c:1.35
--- php3/functions/pdf.c:1.34 Wed Jun 30 06:11:06 1999
+++ php3/functions/pdf.c Wed Jun 30 16:40:31 1999
@@ -27,7 +27,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: pdf.c,v 1.34 1999/06/30 10:11:06 steinm Exp $ */
+/* $Id: pdf.c,v 1.35 1999/06/30 20:40:31 steinm Exp $ */
 
 /* pdflib 0.6 is subject to the ALADDIN FREE PUBLIC LICENSE.
    Copyright (C) 1997 Thomas Merz. */
@@ -219,7 +219,7 @@
 void php3_info_pdf(void) {
         /* need to use a PHPAPI function here because it is external module in windows */
 #if HAVE_PDFLIB2
- php3_printf("pdflib %s.", PDFLIB_VERSIONSTRING);
+ php3_printf("pdflib %d.%d", PDF_get_majorversion(), PDF_get_minorversion());
 #else
         php3_printf("%s. AFM files in %s", PDFLIB_VERSION, PDF_DEFAULT_FONT_PATH);
 #endif
@@ -2075,7 +2075,7 @@
 
         pdf_image = PDF_open_GIF(pdf, arg2->value.str.val);
 
- if(!pdf_image) {
+ if(pdf_image < 0) {
                 php3_error(E_WARNING, "Could not open image");
                 RETURN_FALSE;
         }
@@ -2113,7 +2113,7 @@
 
         pdf_image = PDF_open_JPEG(pdf, arg2->value.str.val);
 
- if(!pdf_image) {
+ if(pdf_image < 0) {
                 php3_error(E_WARNING, "Could not open image");
                 RETURN_FALSE;
         }
@@ -2124,7 +2124,7 @@
 /* }}} */
 
 #if HAVE_PDFLIB2
-/* {{{ proto int pdf_open_memory_image(int pdf, string jpegfile)
+/* {{{ proto int pdf_open_memory_image(int pdf, int image)
    Takes an gd image and returns an image for placement in a pdf document */
 void php3_pdf_open_memory_image(INTERNAL_FUNCTION_PARAMETERS) {
         pval *argv[2];
@@ -2221,10 +2221,11 @@
         id=arg2->value.lval;
 #if HAVE_PDFLIB2
         pdf_image = (int) php3_list_find(id,&type);
+ if(pdf_image < 0 || type!=PDF_GLOBAL(le_pdf_image)) {
 #else
         pdf_image = php3_list_find(id,&type);
-#endif
         if(!pdf_image || type!=PDF_GLOBAL(le_pdf_image)) {
+#endif
                 php3_error(E_WARNING,"Unable to find file identifier %d",id);
                 RETURN_FALSE;
         }
@@ -2269,10 +2270,11 @@
         id=arg2->value.lval;
 #if HAVE_PDFLIB2
         pdf_image = (int) php3_list_find(id,&type);
+ if(pdf_image < 0 || type!=PDF_GLOBAL(le_pdf_image)) {
 #else
         pdf_image = php3_list_find(id,&type);
-#endif
         if(!pdf_image || type!=PDF_GLOBAL(le_pdf_image)) {
+#endif
                 php3_error(E_WARNING,"Unable to find file identifier %d",id);
                 RETURN_FALSE;
         }
@@ -2316,10 +2318,11 @@
         id=arg2->value.lval;
 #if HAVE_PDFLIB2
         pdf_image = (int) php3_list_find(id,&type);
+ if(pdf_image < 0 || type!=PDF_GLOBAL(le_pdf_image)) {
 #else
         pdf_image = php3_list_find(id,&type);
-#endif
         if(!pdf_image || type!=PDF_GLOBAL(le_pdf_image)) {
+#endif
                 php3_error(E_WARNING,"Unable to find file identifier %d",id);
                 RETURN_FALSE;
         }
@@ -2359,10 +2362,11 @@
         id=arg2->value.lval;
 #if HAVE_PDFLIB2
         pdf_image = (int) php3_list_find(id,&type);
+ if(pdf_image < 0 || type!=PDF_GLOBAL(le_pdf_image)) {
 #else
         pdf_image = php3_list_find(id,&type);
-#endif
         if(!pdf_image || type!=PDF_GLOBAL(le_pdf_image)) {
+#endif
                 php3_error(E_WARNING,"Unable to find file identifier %d",id);
                 RETURN_FALSE;
         }

-- 
PHP Development Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>