]> granicus.if.org Git - php/commitdiff
MFB
authorRasmus Lerdorf <rasmus@php.net>
Tue, 1 Apr 2003 18:50:31 +0000 (18:50 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Tue, 1 Apr 2003 18:50:31 +0000 (18:50 +0000)
ext/exif/exif.c

index d91aa5a8b4128fbbf9069137b2297e5a85cf0d91..6797a665133826bef17d85d96947b4dc022e55d5 100644 (file)
@@ -3920,17 +3920,9 @@ PHP_FUNCTION(exif_thumbnail)
        }
 
        convert_to_string_ex(p_name);
-       if (arg_c >= 3) {
-               zval_dtor(*p_width);
-               zval_dtor(*p_height);
-       }
-       if (arg_c >= 4) {
-               zval_dtor(*p_imagetype);
-       }
 
        ret = exif_read_file(&ImageInfo, Z_STRVAL_PP(p_name), 1, 0 TSRMLS_CC);
        if (ret==FALSE) {
-               exif_discard_imageinfo(&ImageInfo);
                RETURN_FALSE;
        }
 
@@ -3951,10 +3943,13 @@ PHP_FUNCTION(exif_thumbnail)
                if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
                        exif_scan_thumbnail(&ImageInfo TSRMLS_CC);
                }
+               zval_dtor(*p_width);
+               zval_dtor(*p_height);
                ZVAL_LONG(*p_width,  ImageInfo.Thumbnail.width);
                ZVAL_LONG(*p_height, ImageInfo.Thumbnail.height);
        }
        if (arg_c >= 4) {
+               zval_dtor(*p_imagetype);
                ZVAL_LONG(*p_imagetype, ImageInfo.Thumbnail.filetype);
        }
 
@@ -3984,6 +3979,7 @@ PHP_FUNCTION(exif_imagetype)
        if (zend_get_parameters_ex(1, &arg1) == FAILURE)
                WRONG_PARAM_COUNT;
 
+       convert_to_string_ex(arg1);
        stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
 
        if (stream == NULL) {