getimagetype() broken for jpegs?
| From: | Rasmus Lerdorf | Date: | Wed, 02 Oct 2002 04:48:31 +0000 |
| Subject: | getimagetype() broken for jpegs? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-88836@lists.php.net to get a copy of this message | ||
It seems like php_handle_jpeg() called by getimagetype() is always
returning null. Here is a trace:
937 itype = php_getimagetype(stream, NULL TSRMLS_CC);
938 switch( itype) {
itype is 2 at this point (2 = jpeg)
943 if (info) {
946 result = php_handle_jpeg(stream, NULL TSRMLS_CC);
Breakpoint 2, php_handle_jpeg (stream=0x83ff99c, info=0x0) at
/home/rasmus/php4/ext/standard/image.c:479
479 struct gfxinfo *result = NULL;
480 unsigned int marker = M_PSEUDO;
481 unsigned short length, ff_read=1;
484 marker = php_next_marker(stream, marker, 1, ff_read TSRMLS_CC);
485 ff_read = 0;
486 switch (marker) {
534 if (info) {
537 php_skip_variable(stream TSRMLS_CC);
539 break;
484 marker = php_next_marker(stream, marker, 1, ff_read TSRMLS_CC);
485 ff_read = 0;
486 switch (marker) {
543 return result; /* we're about to hit image data, or are at EOF. stop processing. */
0x0815e7ec 553 }
So result is never filled in as it doesn't think we hit any markers. Yet
a "file foo.jpg" returns:
foo.jpg: JPEG image data, JFIF standard 1.02, resolution (DPI), 72 x 72
I have tried it with a number of different jpegs. My libjpeg is:
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40557000)
Can someone recreate this in current CVS HEAD?
-Rasmus