cvs: php4 /ext/exif exif.c
| From: | Jani Taskinen | Date: | Tue, 26 Jun 2001 09:52:54 +0000 |
| Subject: | cvs: php4 /ext/exif exif.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6022@lists.php.net to get a copy of this message | ||
sniper Tue Jun 26 11:52:54 2001 EDT
Modified files:
/php4/ext/exif exif.c
Log:
Added an optional 2nd parameter 'readall' to read_exif_data.
Index: php4/ext/exif/exif.c
diff -u php4/ext/exif/exif.c:1.20 php4/ext/exif/exif.c:1.21
--- php4/ext/exif/exif.c:1.20 Sat Jun 23 13:26:24 2001
+++ php4/ext/exif/exif.c Tue Jun 26 11:52:54 2001
@@ -1095,11 +1095,12 @@
}
/* }}} */
-/* {{{ proto string read_exif_data(string filename)
+/* {{{ proto string read_exif_data(string filename [, int readall])
Reads the EXIF header data from a JPEG file */
-PHP_FUNCTION(read_exif_data) {
- pval **p_name;
- int ac = ZEND_NUM_ARGS(), ret;
+PHP_FUNCTION(read_exif_data)
+{
+ pval **p_name, **p_readall;
+ int ac = ZEND_NUM_ARGS(), ret, readall=1;
ImageInfoType ImageInfo;
char tmp[64];
@@ -1107,12 +1108,18 @@
ImageInfo.ThumbnailSize = 0;
*/
- if (ac != 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
+ if ((ac < 1 || ac > 2) || zend_get_parameters_ex(ac, &p_name, &p_readall) ==
FAILURE) {
WRONG_PARAM_COUNT;
-
+ }
+
convert_to_string_ex(p_name);
- ret = php_read_jpeg_exif(&ImageInfo, Z_STRVAL_PP(p_name),1);
+ if(ac == 2) {
+ convert_to_long_ex(p_readall);
+ readall = Z_LVAL_PP(p_readall);
+ }
+
+ ret = php_read_jpeg_exif(&ImageInfo, Z_STRVAL_PP(p_name), readall);
if (array_init(return_value) == FAILURE) {
RETURN_FALSE;