php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62284 getimagesize does not work with all supported images
Submitted: 2012-06-10 14:01 UTC Modified: 2013-10-15 11:54 UTC
Votes:5
Avg. Score:3.6 ± 1.0
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:1 (25.0%)
From: dnied at tiscali dot it Assigned:
Status: No Feedback Package: GetImageSize related
PHP Version: 5.3.13 OS: Linux, i386
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-06-10 14:01 UTC] dnied at tiscali dot it
Description:
------------
The getimagesize function does not work with some (allegedly supported) images. I could not observe this on images stored locally, so it only seems to affect images retrieved via the http wrapper.

FWIW, URL length doesn't seem to affect this: I tried a shortened URL for the image that didn't work, and it still didn't work.

Test script:
---------------
~> php -r '$imgInfo = getimagesize("http://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/Disney_Concert_Hall_by_Carol_Highsmith_edit2.jpg/767px-Disney_Concert_Hall_by_Carol_Highsmith_edit2.jpg"); print_r($imgInfo);'
~>
~>
~> php -r '$imgInfo = getimagesize("https://bugs.php.net/images/logo.gif");print_r($imgInfo);'
Array
(
    [0] => 130
    [1] => 67
    [2] => 1
    [3] => width="130" height="67"
    [bits] => 8
    [channels] => 3
    [mime] => image/gif
)
~>

Expected result:
----------------
An array of image properties, for both images

Actual result:
--------------
A boolean false on the 1st image, the expected array of image properties on the 2nd one.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-10 15:17 UTC] laruence@php.net
I can not reproduce this, is the network to wikimedia  okey?
 [2012-06-10 15:47 UTC] dnied at tiscali dot it
Yes, I can get the non-working image with my browser and with wget.

Your comment made me think of a config issue, so I tried an original, untouched php.ini file with all extensions enabled (not that my own php.ini was really tweaked). Still, no go. I do get a couple of warnings for 2 missing libs, but they look unrelated to me (one is a spell-checking lib, the other is SQLite3 -- neither is documented as a dependency to getimagesize):

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/enchant.so' - /usr/lib/php/extensions/enchant.so: cannot open shared object file: No such file or directory in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/enchant.so' - /usr/lib/php/extensions/enchant.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/sqlite3.so' - /usr/lib/php/extensions/sqlite3.so: cannot open shared object file: No such file or directory in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/sqlite3.so' - /usr/lib/php/extensions/sqlite3.so: cannot open shared object file: No such file or directory in Unknown on line 0
 [2013-10-01 15:26 UTC] mike@php.net
-Status: Open +Status: Feedback
 [2013-10-01 15:26 UTC] mike@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

I get "Error generating thumbnail".
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC