cvs: php4 /ext/exif exif.c
| From: | Marcus B�rger | Date: | Sat, 16 Mar 2002 20:25:53 +0000 |
| Subject: | cvs: php4 /ext/exif exif.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-10267@lists.php.net to get a copy of this message | ||
helly Sat Mar 16 15:25:53 2002 EDT
Modified files:
/php4/ext/exif exif.c
Log:
-disabling debug
#Wez: i have an error when closing the original file after stream copy...
Index: php4/ext/exif/exif.c
diff -u php4/ext/exif/exif.c:1.63 php4/ext/exif/exif.c:1.64
--- php4/ext/exif/exif.c:1.63 Sat Mar 16 15:12:17 2002
+++ php4/ext/exif/exif.c Sat Mar 16 15:25:51 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: exif.c,v 1.63 2002/03/16 20:12:17 helly Exp $ */
+/* $Id: exif.c,v 1.64 2002/03/16 20:25:51 helly Exp $ */
/* ToDos
*
@@ -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>
@@ -113,7 +113,7 @@
};
/* }}} */
-#define EXIF_VERSION "1.3 $Id: exif.c,v 1.63 2002/03/16 20:12:17 helly Exp $"
+#define EXIF_VERSION "1.3 $Id: exif.c,v 1.64 2002/03/16 20:25:51 helly Exp $"
PHP_MINFO_FUNCTION(exif);
@@ -2952,7 +2952,7 @@
{
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 @@
} 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 @@
}
/* 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;