cvs: php4 /ext/pdf pdf.c

From: Date: Tue, 21 Nov 2000 07:07:53 +0000
Subject: cvs: php4 /ext/pdf pdf.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2715@lists.php.net to get a copy of this message
dbeu Mon Nov 20 23:07:53 2000 EDT Modified files: /php4/ext/pdf pdf.c Log: fix PDF image open under Win32 Index: php4/ext/pdf/pdf.c diff -u php4/ext/pdf/pdf.c:1.60 php4/ext/pdf/pdf.c:1.61 --- php4/ext/pdf/pdf.c:1.60 Fri Nov 3 12:13:45 2000 +++ php4/ext/pdf/pdf.c Mon Nov 20 23:07:53 2000 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdf.c,v 1.60 2000/11/03 20:13:45 joey Exp $ */ +/* $Id: pdf.c,v 1.61 2000/11/21 07:07:53 dbeu Exp $ */ /* pdflib 2.02 is subject to the ALADDIN FREE PUBLIC LICENSE. Copyright (C) 1997 Thomas Merz. */ @@ -2323,6 +2323,7 @@ int id, type; int pdf_image; PDF *pdf; + char *image; PDF_TLS_VARS; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { @@ -2338,8 +2339,10 @@ RETURN_FALSE; } - pdf_image = PDF_open_image_file(pdf, "gif", (*arg2)->value.str.val, "", 0); + virtual_filepath((*arg2)->value.str.val, &image); + pdf_image = PDF_open_image_file(pdf, "gif", image, "", 0); + if(pdf_image < 0) { php_error(E_WARNING, "Could not open image"); RETURN_FALSE; @@ -2357,6 +2360,7 @@ int id, type; int pdf_image; PDF *pdf; + char *image; PDF_TLS_VARS; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { @@ -2371,8 +2375,10 @@ php_error(E_WARNING,"Unable to find file identifier %d",id); RETURN_FALSE; } + + virtual_filepath((*arg2)->value.str.val, &image); - pdf_image = PDF_open_image_file(pdf, "jpeg", (*arg2)->value.str.val, "", 0); + pdf_image = PDF_open_image_file(pdf, "jpeg", image, "", 0); if(pdf_image < 0) { php_error(E_WARNING, "Could not open image"); @@ -2391,6 +2397,7 @@ int id, type; int pdf_image; PDF *pdf; + char *image; PDF_TLS_VARS; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { @@ -2405,8 +2412,10 @@ php_error(E_WARNING,"Unable to find file identifier %d",id); RETURN_FALSE; } + + virtual_filepath((*arg2)->value.str.val, &image); - pdf_image = PDF_open_image_file(pdf, "png", (*arg2)->value.str.val, "", 0); + pdf_image = PDF_open_image_file(pdf, "png", image, "", 0); if(pdf_image < 0) { php_error(E_WARNING, "Could not open image"); @@ -2425,6 +2434,7 @@ int id, type; int pdf_image; PDF *pdf; + char *image; PDF_TLS_VARS; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { @@ -2440,8 +2450,10 @@ RETURN_FALSE; } - pdf_image = PDF_open_image_file(pdf, "tiff", (*arg2)->value.str.val, "", 0); + virtual_filepath((*arg2)->value.str.val, &image); + pdf_image = PDF_open_image_file(pdf, "tiff", image, "", 0); + if(pdf_image < 0) { php_error(E_WARNING, "Could not open image"); RETURN_FALSE; @@ -2459,6 +2471,7 @@ int id, type; int pdf_image; PDF *pdf; + char *image; PDF_TLS_VARS; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { @@ -2474,8 +2487,10 @@ php_error(E_WARNING,"Unable to find file identifier %d",id); RETURN_FALSE; } + + virtual_filepath((*arg3)->value.str.val, &image); - pdf_image = PDF_open_image_file(pdf, (*arg2)->value.str.val, (*arg3)->value.str.val, "", 0); + pdf_image = PDF_open_image_file(pdf, (*arg2)->value.str.val, image, "", 0); if(pdf_image < 0) { php_error(E_WARNING, "Could not open image");

« previous php.cvs (#2715) next »