cvs: php4 /ext/pdf pdf.c

From: Date: Tue, 03 Jul 2001 14:35:07 +0000
Subject: cvs: php4 /ext/pdf pdf.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6067@lists.php.net to get a copy of this message
rjs Tue Jul 3 10:35:07 2001 EDT Modified files: /php4/ext/pdf pdf.c Log: - fixed bug in pdf_open_image_file when using images as masks. - clean up some comments Index: php4/ext/pdf/pdf.c diff -u php4/ext/pdf/pdf.c:1.89 php4/ext/pdf/pdf.c:1.90 --- php4/ext/pdf/pdf.c:1.89 Fri Jun 15 06:44:49 2001 +++ php4/ext/pdf/pdf.c Tue Jul 3 10:35:06 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdf.c,v 1.89 2001/06/15 10:44:49 sniper Exp $ */ +/* $Id: pdf.c,v 1.90 2001/07/03 14:35:06 rjs Exp $ */ /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE. Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */ @@ -74,9 +74,6 @@ /* {{{ pdf_functions[] */ function_entry pdf_functions[] = { - /* sorry for sorting this stuff like the pdflib manual, - but this helps me to see what is done :) RJS - I'll try to avoid rearanging the sources below that => new functions to the end */ PHP_FE(pdf_new, NULL) /* new function */ PHP_FE(pdf_delete, NULL) /* new function */ PHP_FE(pdf_open_file, NULL) /* new function */ @@ -274,11 +271,11 @@ switch (type){ case PDF_NonfatalError: /* - * PDFlib warings should be visible to the user + * PDFlib warnings should be visible to the user. * If he decides to live with PDFlib warnings - * he may user the PDFlib function + * he may use the PDFlib function * pdf_set_parameter($p, "warning" 0) to switch off - * the warnings inside PDFlib + * the warnings inside PDFlib. */ php_error(E_WARNING,"Internal PDFlib warning: %s", shortmsg); return; @@ -349,7 +346,7 @@ #else php_info_print_table_row(2, "PDFlib GmbH Version", tmp ); #endif - php_info_print_table_row(2, "Revision", "$Revision: 1.89 $" ); + php_info_print_table_row(2, "Revision", "$Revision: 1.90 $" ); php_info_print_table_end(); } @@ -751,7 +748,7 @@ if(argc < 3) WRONG_PARAM_COUNT; value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET); } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "font"))) { - value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), 0.0)+PDFLIB_IMAGE_OFFSET; + value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), 0.0)+PDFLIB_FONT_OFFSET; } else { if(argc < 3) { value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), 0.0); @@ -1885,6 +1882,8 @@ PDF *pdf; int pdf_image, argc; char *image; + char *stringparam; + int intparam; switch ((argc = ZEND_NUM_ARGS())) { case 3: @@ -1915,7 +1914,15 @@ } else { convert_to_string_ex(arg4); convert_to_long_ex(arg5); - pdf_image = PDF_open_image_file(pdf, Z_STRVAL_PP(arg2), image, Z_STRVAL_PP(arg4), Z_LVAL_PP(arg5)); + + stringparam = Z_STRVAL_PP(arg4); + intparam = Z_LVAL_PP(arg5); + + /* adjust the image handle */ + if (!strcmp(stringparam, "masked")) + intparam -= PDFLIB_IMAGE_OFFSET; + + pdf_image = PDF_open_image_file(pdf, Z_STRVAL_PP(arg2), image, stringparam, intparam); } if (pdf_image == -1) {

« previous php.cvs (#6067) next »