diff options
author | Marcus Boerger <helly@php.net> | 2002-03-16 20:25:51 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2002-03-16 20:25:51 +0000 |
commit | d50102b6ab4289baece997c7ac4f4fa621d4a186 (patch) | |
tree | 82bc9d8c9849f7c5f760b77d2dd8d7791b89aa24 /ext/exif | |
parent | f24caf324496af6c4e6c6695017ebe8cd5e4c2f5 (diff) | |
download | php-git-d50102b6ab4289baece997c7ac4f4fa621d4a186.tar.gz |
-disabling debug
#Wez: i have an error when closing the original file after stream copy...
Diffstat (limited to 'ext/exif')
-rw-r--r-- | ext/exif/exif.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c index d39ffb157b..2d58f7a222 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -67,7 +67,7 @@ * while extending the module as it shows if you are at the right position. * You are always considered to have a copy of TIFF6.0 and EXIF2.10 standard. */ -#define EXIF_DEBUG +#undef EXIF_DEBUG #include "php_exif.h" #include <math.h> @@ -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; + php_stream *mem_stream, *org_stream; /* Start with an empty image information structure. */ memset(ImageInfo, 0, sizeof(*ImageInfo)); @@ -2981,16 +2981,18 @@ int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnai } else { ImageInfo->FileDateTime = 0; #ifdef HAVE_PHP_STREAM - if ( !ImageInfo->infile->ops->seek) { - php_error(E_NOTICE,"Using a memory 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(); - php_error(E_NOTICE,"Using a memory stream: created"); - ImageInfo->FileSize = php_stream_copy_to_stream(ImageInfo->infile, mem_stream, PHP_STREAM_COPY_ALL); - php_error(E_NOTICE,"Using a memory stream: copy done %d", ImageInfo->FileSize); - php_error(E_NOTICE,"Using a memory stream: closed"); -// auto_fclose(ImageInfo->infile); - php_error(E_NOTICE,"Using a memory stream: closed"); + org_stream = ImageInfo->infile; + ImageInfo->FileSize = php_stream_copy_to_stream(org_stream, mem_stream, PHP_STREAM_COPY_ALL); + //auto_fclose(org_stream); ImageInfo->infile = mem_stream; + #ifdef EXIF_DEBUG + php_error(E_NOTICE,"stream is not stdio: copy done"); + #endif } #else ImageInfo->FileSize = 0; @@ -2998,9 +3000,7 @@ int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnai } /* Scan the JPEG headers. */ - php_error(E_NOTICE,"Using a memory stream: exif_scan_FILE_header"); ret = exif_scan_FILE_header(ImageInfo); - php_error(E_NOTICE,"Using a memory stream: exif_scan_FILE_header done"); auto_fclose(ImageInfo->infile); return ret; |