From: Marcus Boerger Date: Sun, 17 Mar 2002 12:16:29 +0000 (+0000) Subject: #removed code to track down error in streams X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~1315 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20f2e6328977c2086d6e9c03eb528f339004463b;p=php #removed code to track down error in streams --- diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 11e194ef62..37b60276cd 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2952,7 +2952,7 @@ int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnai { int ret; struct stat st; - php_stream *mem_stream, *org_stream; + php_stream *mem_stream; /* Start with an empty image information structure. */ memset(ImageInfo, 0, sizeof(*ImageInfo)); @@ -2960,7 +2960,7 @@ int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnai ImageInfo->motorola_intel = 0; #ifdef HAVE_PHP_STREAM - ImageInfo->infile = php_stream_open_wrapper(FileName, "rb", REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL TSRMLS_CC); + ImageInfo->infile = php_stream_open_wrapper(FileName, "rb", IGNORE_PATH|ENFORCE_SAFE_MODE, NULL TSRMLS_CC); #else ImageInfo->infile = VCWD_FOPEN(FileName, "rb"); /* Unix ignores 'b', windows needs it. */ #endif @@ -2982,18 +2982,11 @@ int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnai ImageInfo->FileDateTime = 0; #ifdef HAVE_PHP_STREAM if ( !php_stream_is(ImageInfo->infile, PHP_STREAM_IS_STDIO)) { - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"stream is not stdio: using a memory stream"); - #endif mem_stream = php_memory_stream_create(); - org_stream = ImageInfo->infile; - ImageInfo->FileSize = php_stream_copy_to_stream(org_stream, mem_stream, PHP_STREAM_COPY_ALL); - org_stream->wrapper->destroy = NULL; - auto_fclose(org_stream); +/* mem_stream = php_stream_fopen_tmpfile(); files my be big */ + ImageInfo->FileSize = php_stream_copy_to_stream(ImageInfo->infile, mem_stream, PHP_STREAM_COPY_ALL); + auto_fclose(ImageInfo->infile); ImageInfo->infile = mem_stream; - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"stream is not stdio: copy %d done", ImageInfo->FileSize); - #endif } #else ImageInfo->FileSize = 0;