#21676 [Com]: GetImageSize nolonger works
| From: | hex6ng at yahoo dot com | Date: | Tue, 14 Oct 2003 07:15:36 +0000 |
| Subject: | #21676 [Com]: GetImageSize nolonger works | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-48957@lists.php.net to get a copy of this message | ||
ID: 21676
Comment by: hex6ng at yahoo dot com
Reported By: moderator at blackpeeps dot com
Status: Closed
Bug Type: GetImageSize related
Operating System: RAQ4-Latest Patches/Apache 1.3.2
PHP Version: 4.3.0
New Comment:
I'm experiencing the same problem after I upgraded php from version
4.2.4-CVS (php4-STABLE-200302222230) to 4.3.3 Release. The reason I
upgraded was because 4.3.3 fixes the PATH_INFO bug that I had.
But......A whole bunch of my thumbnails stopped showing up. The really
odd thing is I'm using Imagick instead of GD. But I'm also using
getimagesize(). I changed my function to use ALL three methods of
retrieving the size, but ALL return null size for these images.
http://filegrid.net/index.html?meta_id=5ca930302a942ef8906a6a80855856af
here is the function I use to get the size
function file_image_size($meta_id)
{
$file_obj = file_object($meta_id);
if(!$file_obj) return NULL;
$image_size = getimagesize($file_obj->file_location);
if(!$image_size[0])
{
if(!$image_size[0])
{
$handle = imagick_readimage($file_obj->file_location);
if(imagick_iserror( $handle ))
return NULL;
$image_size[0] = imagick_getwidth($handle);
$image_size[1] = imagick_getheight($handle);
//imagick_free($handle);
if(!$image_size[0] && stristr($file_obj->mime_type,
'image/jp'))
{
$img = imagecreatefromjpeg ($filename);
$image_size[0] = imagesx ($img);
$image_size[1] = imagesy ($img);
imagedestroy ($img);
}
}
}
return $image_size;
}
Previous Comments:
------------------------------------------------------------------------
[2003-05-12 03:07:57] fmeriot at hotmail dot com
I'have experienced the same problem with the getimagesize() function. I
use it to test the size of a distant image to display on my site. If
width is greater than 500 pix I force the width parameter to 500. This
function works with some images but not with all.
Example:
It works with this one:
http://images.ea.com/eagames/official/bf1942/screenshots_rome/full_screen_21.jpg
It doesn't work with this one:
http://www.dayofdefeatmod.com/media/images/Jagd1.jpg
I have no error message. When I do that:
$size =
@getimagesize("http://www.dayofdefeatmod.com/media/images/Jagd1.jpg");
echo $size[0];
Nothing happens, nothing appears.
------------------------------------------------------------------------
[2003-04-29 16:10:24] michael dot mauch at gmx dot de
So you have two options:
a) Wait until PHP 4.3.2 is released and installed at your site.
b) Invent a time travel machine and give it to the PHP developers, so
PHP 4.3.0 can be fixed before it was installed at your site.
------------------------------------------------------------------------
[2003-04-29 09:23:20] ruud at webhero dot nl
It still doesn't work.
My site still does have problems with @Getimagesize
example:
http://www.gamemag.nl/nieuws/item.php?id=2109
You see three screens, the fourth doesn't work.
All images are from an external website and use the same functions.
I don't have permission to change my PHPversion.
Please help,
Rudy Luiten
------------------------------------------------------------------------
[2003-02-22 05:19:09] helly@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
This one has been fixed by fixing a streams issue.
------------------------------------------------------------------------
[2003-01-31 13:52:04] sniper@php.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 "Open". Thank you.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/21676
--
Edit this bug report at http://bugs.php.net/?id=21676&edit=1