473,498 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getimagesize() function problem

Hi everybody of the PHP community,

I am using the php function "getimagesize()" to access the
width/height of an image
from the Web. This function should return false if image is not
available.

Most of the time the function works correctly, but in 2 or 3 cases I
have
a problem like, search is going on for minutes, and the function does
not return a
false return-code as it should if image is not available ?

If I enter the URL directly in the browser, the result is the same,
browser search for
Minutes and does not return any error.

Does anyone has experience with a similar problem, is there a timeout
that we can
Give to the function getimagesize() ?

Your comments are very welcome and best regards

Tks for your help
RCB845
Jul 17 '05 #1
4 3940
DH
rc****@yahoo.fr wrote:
Hi everybody of the PHP community,

I am using the php function "getimagesize()" to access the
width/height of an image
from the Web. This function should return false if image is not
available.


Shouldn't you first check to make sure the image exists?

$source = './images/some.gif';

file_exists($source)
? list($width, $height, $type, $attrib) = getimagesize($source)
: die('Unable to locate a required script: '.$source);
Jul 17 '05 #2
<rc****@yahoo.fr> wrote in message
news:18**************************@posting.google.c om...
Hi everybody of the PHP community,

I am using the php function "getimagesize()" to access the
width/height of an image
from the Web. This function should return false if image is not
available.

Most of the time the function works correctly, but in 2 or 3 cases I
have
a problem like, search is going on for minutes, and the function does
not return a
false return-code as it should if image is not available ?

If I enter the URL directly in the browser, the result is the same,
browser search for
Minutes and does not return any error.

Does anyone has experience with a similar problem, is there a timeout
that we can
Give to the function getimagesize() ?

Your comments are very welcome and best regards

Tks for your help
RCB845


Trying ini_set('default_socket_timeout', ???).
Jul 17 '05 #3
DH <do*****@comcast.net> wrote in message news:<R6********************@comcast.com>...
rc****@yahoo.fr wrote:
Hi everybody of the PHP community,

I am using the php function "getimagesize()" to access the
width/height of an image
from the Web. This function should return false if image is not
available.


Shouldn't you first check to make sure the image exists?

$source = './images/some.gif';

file_exists($source)
? list($width, $height, $type, $attrib) = getimagesize($source)
: die('Unable to locate a required script: '.$source);


Tks for the info, but I think file_exists() cannot be used
with URL but only with regular files.
RCB845 Feb 18
Jul 17 '05 #4
"Chung Leong" <ch***********@hotmail.com> wrote in message news:<X9********************@comcast.com>...
<rc****@yahoo.fr> wrote in message
news:18**************************@posting.google.c om...
Hi everybody of the PHP community,

I am using the php function "getimagesize()" to access the
width/height of an image
from the Web. This function should return false if image is not
available.

Most of the time the function works correctly, but in 2 or 3 cases I
have
a problem like, search is going on for minutes, and the function does
not return a
false return-code as it should if image is not available ?

If I enter the URL directly in the browser, the result is the same,
browser search for
Minutes and does not return any error.

Does anyone has experience with a similar problem, is there a timeout
that we can
Give to the function getimagesize() ?

Your comments are very welcome and best regards

Tks for your help
RCB845


Trying ini_set('default_socket_timeout', ???).

Thank you for the suggestion, but unfortunately I cannot use it
due to PHP version we use. I think "default_socket_timeout" is only
available from 4.3 on.
Tks any and best regards
RCB845
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8895
by: Jonathan Lindo | last post by:
Hey All, Running Redhat9, Apache 2.0.40, PHP 4.3.4. GD support is enabled. GetImageSize() returns FALSE on almost all JPGs, but does return with the correct info on *some* JPGs. The array...
1
3662
by: Philip D Heady | last post by:
What is with this error message?????? First part validates, second part fails... getimagesize (filename...) failed to open stream: No such file or directory } elseif ($photo) { $ext =...
1
4268
by: Lucid77 | last post by:
I keep getting an error on line 43 which Is the line in which $image_size = getimagesize($fullsized); occurs, although I cannot seem to find the problem. Any help is much appreciated. Sam ...
1
9167
by: sree | last post by:
Hi, am new bie to this group. I requesting help from you all. Am geeting warnig with getimagesize() function. I will explain my query by first giving my code. $src = $_GET; $imageInfo =...
2
3515
by: bizt | last post by:
Hi, Is it possible to obtain the width/ height of an image when that image is dyanically created using a PHP script and passing GET attributes. For example: <img...
6
17418
by: bluesky9394 | last post by:
I encounter the following error. Warning: getimagesize(WebRoot/common/images/profile/) : failed to open stream: Permission denied in C:\Data\PHPSites\kamwo\indextmp-new.php on line 296 but it's...
1
2241
by: Voodoo Jai | last post by:
I have a dbn of images that I retrieve using SQL statements in dreamweaver. I want to get the file name using SQL and then place it into the "getimagesize" function and then use this info...
7
5142
by: Ja NE | last post by:
(as first - thank you for all your help several years ago, and second - please apologise me for my clumsy enlgish) so, preface: some users on my photo related site sometimes enter (link) giant...
0
2173
by: RobUK | last post by:
We have Apache on the local network managing several websites that are accessed using virtual domains (configured in the local machine's hosts file, eg. 192.168.1.10 points to dev.somedomain.com). ...
0
7197
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4899
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4584
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.