cvs: php4 /ext/exif exif.c

From: Date: Sun, 17 Mar 2002 12:16:30 +0000
Subject: cvs: php4 /ext/exif exif.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-10285@lists.php.net to get a copy of this message
helly Sun Mar 17 07:16:30 2002 EDT Modified files: /php4/ext/exif exif.c Log: #removed code to track down error in streams Index: php4/ext/exif/exif.c diff -u php4/ext/exif/exif.c:1.65 php4/ext/exif/exif.c:1.66 --- php4/ext/exif/exif.c:1.65 Sat Mar 16 16:19:17 2002 +++ php4/ext/exif/exif.c Sun Mar 17 07:16:29 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: exif.c,v 1.65 2002/03/16 21:19:17 helly Exp $ */ +/* $Id: exif.c,v 1.66 2002/03/17 12:16:29 helly Exp $ */ /* ToDos * @@ -113,7 +113,7 @@ }; /* }}} */ -#define EXIF_VERSION "1.3 $Id: exif.c,v 1.65 2002/03/16 21:19:17 helly Exp $" +#define EXIF_VERSION "1.3 $Id: exif.c,v 1.66 2002/03/17 12:16:29 helly Exp $" PHP_MINFO_FUNCTION(exif); @@ -2952,7 +2952,7 @@ { 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 @@ 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 @@ 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;

« previous php.cvs (#10285) next »