CVS update: php3/functions
| From: | steinm | Date: | Mon, 11 Jan 1999 11:35:51 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3468@lists.php.net to get a copy of this message | ||
Date: Monday January 11, 1999 @ 6:35
Author: steinm
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv27801/functions
Modified Files:
pdf.c
Log Message:
- fixed confusion of pdf_open_gif() and pdf_open_jpeg().
Index: php3/functions/pdf.c
diff -c php3/functions/pdf.c:1.21 php3/functions/pdf.c:1.22
*** php3/functions/pdf.c:1.21 Fri Jan 8 09:14:56 1999
--- php3/functions/pdf.c Mon Jan 11 06:35:50 1999
***************
*** 27,33 ****
+----------------------------------------------------------------------+
*/
! /* $Id: pdf.c,v 1.21 1999/01/08 14:14:56 rasmus Exp $ */
/* pdflib 0.6 is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997 Thomas Merz. */
--- 27,33 ----
+----------------------------------------------------------------------+
*/
! /* $Id: pdf.c,v 1.22 1999/01/11 11:35:50 steinm Exp $ */
/* pdflib 0.6 is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997 Thomas Merz. */
***************
*** 137,143 ****
{"pdf_add_outline", php3_pdf_add_outline, NULL},
{"pdf_set_transition", php3_pdf_set_transition, NULL},
{"pdf_set_duration", php3_pdf_set_duration, NULL},
! {"pdf_open_jpeg", php3_pdf_open_gif, NULL},
{"pdf_open_gif", php3_pdf_open_gif, NULL},
{"pdf_close_image", php3_pdf_close_image, NULL},
{"pdf_place_image", php3_pdf_place_image, NULL},
--- 137,143 ----
{"pdf_add_outline", php3_pdf_add_outline, NULL},
{"pdf_set_transition", php3_pdf_set_transition, NULL},
{"pdf_set_duration", php3_pdf_set_duration, NULL},
! {"pdf_open_jpeg", php3_pdf_open_jpeg, NULL},
{"pdf_open_gif", php3_pdf_open_gif, NULL},
{"pdf_close_image", php3_pdf_close_image, NULL},
{"pdf_place_image", php3_pdf_place_image, NULL},
***************
*** 1804,1810 ****
}
/* }}} */
! /* {{{ proto int pdf_open_jpeg(void)
Returns an image for placement in a pdf document */
void php3_pdf_open_gif(INTERNAL_FUNCTION_PARAMETERS) {
pval *arg1, *arg2;
--- 1804,1810 ----
}
/* }}} */
! /* {{{ proto int pdf_open_gif(void)
Returns an image for placement in a pdf document */
void php3_pdf_open_gif(INTERNAL_FUNCTION_PARAMETERS) {
pval *arg1, *arg2;
***************
*** 1827,1832 ****
--- 1827,1866 ----
}
pdf_image = PDF_open_GIF(pdf, arg2->value.str.val);
+
+ if(!pdf_image) {
+ php3_error(E_WARNING, "Could not open image");
+ RETURN_FALSE;
+ }
+
+ id = php3_list_insert(pdf_image,PDF_GLOBAL(le_pdf_image));
+ RETURN_LONG(id);
+ }
+ /* }}} */
+
+ /* {{{ proto int pdf_open_jpeg(void)
+ Returns an image for placement in a pdf document */
+ void php3_pdf_open_jpeg(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *arg1, *arg2;
+ int id, type;
+ PDF_image *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 = php3_list_find(id,&type);
+ if(!pdf || type!=PDF_GLOBAL(le_pdf)) {
+ php3_error(E_WARNING,"Unable to find file identifier %d",id);
+ RETURN_FALSE;
+ }
+
+ pdf_image = PDF_open_JPEG(pdf, arg2->value.str.val);
if(!pdf_image) {
php3_error(E_WARNING, "Could not open image");
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net