summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Steinmann <steinm@php.net>2000-02-10 10:20:31 +0000
committerUwe Steinmann <steinm@php.net>2000-02-10 10:20:31 +0000
commite79c87aca03e5356007c00da3c8de35e92d55f32 (patch)
treeed866f0670f3456fc463710ac602e4af2c601bd6
parentc59c663619346c2e9194cc8bd57e8b3e6371383d (diff)
downloadphp-git-e79c87aca03e5356007c00da3c8de35e92d55f32.tar.gz
- added pdf_open_tiff()
-rw-r--r--ext/pdf/pdf.c35
-rw-r--r--ext/pdf/php_pdf.h1
2 files changed, 36 insertions, 0 deletions
diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c
index 9b4900edb1..36c6e71f1b 100644
--- a/ext/pdf/pdf.c
+++ b/ext/pdf/pdf.c
@@ -141,6 +141,7 @@ function_entry pdf_functions[] = {
PHP_FE(pdf_set_transition, NULL)
PHP_FE(pdf_set_duration, NULL)
PHP_FE(pdf_open_jpeg, NULL)
+ PHP_FE(pdf_open_tiff, NULL)
#if HAVE_LIBGD13
PHP_FE(pdf_open_memory_image, NULL)
#endif
@@ -2146,6 +2147,40 @@ PHP_FUNCTION(pdf_open_jpeg) {
}
/* }}} */
+/* {{{ proto int pdf_open_tiff(int pdf, string tifffile)
+ Opens a tiff file and returns an image for placement in a pdf document */
+PHP_FUNCTION(pdf_open_tiff) {
+ pval *arg1, *arg2;
+ int id, type;
+ int pdf_image;
+ PDF *pdf;
+ PDF_TLS_VARS;
+
+ if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long(arg1);
+ convert_to_string(arg2);
+ id=arg1->value.lval;
+ pdf = zend_list_find(id,&type);
+ if(!pdf || type!=PDF_GLOBAL(le_pdf)) {
+ php_error(E_WARNING,"Unable to find file identifier %d",id);
+ RETURN_FALSE;
+ }
+
+ pdf_image = PDF_open_TIFF(pdf, arg2->value.str.val);
+
+ if(pdf_image < 0) {
+ php_error(E_WARNING, "Could not open image");
+ RETURN_FALSE;
+ }
+
+ id = zend_list_insert((void *) pdf_image,PDF_GLOBAL(le_pdf_image));
+ RETURN_LONG(id);
+}
+/* }}} */
+
#if HAVE_LIBGD13
/* {{{ proto int pdf_open_memory_image(int pdf, int image)
Takes an gd image and returns an image for placement in a pdf document */
diff --git a/ext/pdf/php_pdf.h b/ext/pdf/php_pdf.h
index 53eb804fec..0be649a44a 100644
--- a/ext/pdf/php_pdf.h
+++ b/ext/pdf/php_pdf.h
@@ -103,6 +103,7 @@ PHP_FUNCTION(pdf_add_outline);
PHP_FUNCTION(pdf_set_transition);
PHP_FUNCTION(pdf_set_duration);
PHP_FUNCTION(pdf_open_jpeg);
+PHP_FUNCTION(pdf_open_tiff);
#if HAVE_LIBGD13
PHP_FUNCTION(pdf_open_memory_image);
#endif