summaryrefslogtreecommitdiff
path: root/ext/pdf
diff options
context:
space:
mode:
authorDaniel Beulshausen <dbeu@php.net>2000-11-21 07:08:01 +0000
committerDaniel Beulshausen <dbeu@php.net>2000-11-21 07:08:01 +0000
commitfda42b034f7a9e6702293962e525b8e8b48a8693 (patch)
tree0bb8789e1731a6496cdd3d736b93dea246719a91 /ext/pdf
parent67f66b32c0b378cf9fae24c46e3ead7e161e6377 (diff)
downloadphp-git-fda42b034f7a9e6702293962e525b8e8b48a8693.tar.gz
fix PDF image open under Win32
Diffstat (limited to 'ext/pdf')
-rw-r--r--ext/pdf/pdf.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c
index 249009e779..7fa837b761 100644
--- a/ext/pdf/pdf.c
+++ b/ext/pdf/pdf.c
@@ -2323,6 +2323,7 @@ PHP_FUNCTION(pdf_open_gif) {
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,7 +2339,9 @@ PHP_FUNCTION(pdf_open_gif) {
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");
@@ -2357,6 +2360,7 @@ PHP_FUNCTION(pdf_open_jpeg) {
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) {
@@ -2372,7 +2376,9 @@ PHP_FUNCTION(pdf_open_jpeg) {
RETURN_FALSE;
}
- pdf_image = PDF_open_image_file(pdf, "jpeg", (*arg2)->value.str.val, "", 0);
+ virtual_filepath((*arg2)->value.str.val, &image);
+
+ 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 @@ PHP_FUNCTION(pdf_open_png) {
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) {
@@ -2406,7 +2413,9 @@ PHP_FUNCTION(pdf_open_png) {
RETURN_FALSE;
}
- pdf_image = PDF_open_image_file(pdf, "png", (*arg2)->value.str.val, "", 0);
+ virtual_filepath((*arg2)->value.str.val, &image);
+
+ 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 @@ PHP_FUNCTION(pdf_open_tiff) {
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,7 +2450,9 @@ PHP_FUNCTION(pdf_open_tiff) {
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");
@@ -2459,6 +2471,7 @@ PHP_FUNCTION(pdf_open_image_file) {
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) {
@@ -2475,7 +2488,9 @@ PHP_FUNCTION(pdf_open_image_file) {
RETURN_FALSE;
}
- pdf_image = PDF_open_image_file(pdf, (*arg2)->value.str.val, (*arg3)->value.str.val, "", 0);
+ virtual_filepath((*arg3)->value.str.val, &image);
+
+ 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");