From: [EMAIL PROTECTED] Operating system: Linux 2.2.19 (Debian) PHP version: 4.3.0 PHP Bug Type: GetImageSize related Bug description: GetImageSize seems confused on certain JPGs from certain hosts
GetImageSize() seems confused on certain JPGs from freeservers. The JPG is valid (you can load it from your web-browser). Script to reproduce: <? $res = GetImageSize("http://guildprime.8m.net/bug.jpg"); if($res == FALSE) { print("Erk! GetImageSize returned FALSE!"); } else { print_r($res); } print("<br><br>"); $res = GetImageSize("http://guildprime.8m.net/notbug.jpg"); if($res == FALSE) { print("Erk! GetImageSize returned FALSE!"); } else { print_r($res); } ?> The script SHOULD report: Array ( [0] => 396 [1] => 178 [2] => 2 [3] => width="396" height="178" [bits] => 8 [channels] => 3 ) Array ( [0] => 800 [1] => 600 [2] => 2 [3] => width="800" height="600" [bits] => 8 [channels] => 3 ) And it does when I copy the file to my local Apache web server and change the script to point there instead. It also works on a second server I have running PHP 4.1.2. However, with the URL listed, under PHP 4.3.0, it reports: Erk! GetImageSize returned FALSE! Array ( [0] => 800 [1] => 600 [2] => 2 [3] => width="800" height="600" [bits] => 8 [channels] => 3 [mime] => image/jpeg ) Configuration options: ./configure --with-apxs --with-zlib --with-bz2 --with-gd=/usr --enable-gd-native-ttf --with-mysql=/usr --enable-sockets --prefix=/usr --with-ttf --enable-ftp Troubleshooting steps already taken: - I tried copying the image to my local web server, changed the script to look there, and it works. - Dozens of other JPGs on freeservers work as well. - It seems this combination of server and image file is causing GetImageSize() to fail. When I point my web browser at the same URL, the picture comes up. - I tried putting the picture into GIMP and resaving out - the re-saved image also has the same problems. (This file is bug2.jpg at the same site.) - Running 'identify -verbose' on the files shows perhaps the difference of Resolution (notbug.jpg is 300x300 pixels/inch, as are most of the other pictures, while bug.jpg and bug2.jpg are at72x72 pixels/inch) may be part of what's triggering it. - I have re-downloaded the source, re-compiled and re-installed with the above options, with no change in results. - Running the script from the command line has no change in results. All-in-all, quite strange... -- Edit bug report at http://bugs.php.net/?id=22120&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=22120&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=22120&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=22120&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=22120&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=22120&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=22120&r=support Expected behavior: http://bugs.php.net/fix.php?id=22120&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=22120&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=22120&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=22120&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22120&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=22120&r=dst IIS Stability: http://bugs.php.net/fix.php?id=22120&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=22120&r=gnused