summaryrefslogtreecommitdiff
path: root/ext/exif/exif.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-03-17 12:16:29 +0000
committerMarcus Boerger <helly@php.net>2002-03-17 12:16:29 +0000
commit20f2e6328977c2086d6e9c03eb528f339004463b (patch)
treed5282b1482dd4979ffbeba9725ea441917b34f12 /ext/exif/exif.c
parent34cb24fcf76003ef0805ffd38c5b17ad84b2d2c8 (diff)
downloadphp-git-20f2e6328977c2086d6e9c03eb528f339004463b.tar.gz
#removed code to track down error in streams
Diffstat (limited to 'ext/exif/exif.c')
-rw-r--r--ext/exif/exif.c17
1 files changed, 5 insertions, 12 deletions
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;