rare, intermittent bug with getimagesize ?

This is a discussion on rare, intermittent bug with getimagesize ? within the PHP Language forums, part of the PHP Programming Forums category; I've got an intermittent bug that is very hard to trace. On my site, if I log into a ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-12-2006
lawrence k
 
Posts: n/a
Default rare, intermittent bug with getimagesize ?


I've got an intermittent bug that is very hard to trace. On my site, if
I log into a new account and try to upload some images, something goes
wrong the first time. Everything works fine after the first time, but
the first time getimagesize fails to return a type, which is blank in
the following error messge. I'm going to check for weird path issues
that might be related to first login, but is anyone aware of situations
where getimagesize doesn't return a type?


list ($w, $h, $type, $attr) = getimagesize ($src_path);
if (($side = $w) > $h) $side = $h;
$dst = imagecreatetruecolor (PHOTO_SIDEX, PHOTO_SIDEY);

if ($type == 1 || $type == 2 || $type == 3 || $type == 6) {
/// lots of code goes here
} else {
$controller->error("In makeCroppedPhoto the type of image was '$type'
for image '$src_path' which is not an allowed type. All that is allowed
is gif(1), jpg(2), png(3) and bmp(6)."); }

Reply With Quote
  #2 (permalink)  
Old 09-12-2006
lawrence k
 
Posts: n/a
Default Re: rare, intermittent bug with getimagesize ?


lawrence k wrote:
> I've got an intermittent bug that is very hard to trace. On my site, if
> I log into a new account and try to upload some images, something goes
> wrong the first time. Everything works fine after the first time, but
> the first time getimagesize fails to return a type, which is blank in
> the following error messge. I'm going to check for weird path issues
> that might be related to first login, but is anyone aware of situations
> where getimagesize doesn't return a type?
>
>
> list ($w, $h, $type, $attr) = getimagesize ($src_path);
> if (($side = $w) > $h) $side = $h;
> $dst = imagecreatetruecolor (PHOTO_SIDEX, PHOTO_SIDEY);
>
> if ($type == 1 || $type == 2 || $type == 3 || $type == 6) {
> /// lots of code goes here
> } else {
> $controller->error("In makeCroppedPhoto the type of image was '$type'
> for image '$src_path' which is not an allowed type. All that is allowed
> is gif(1), jpg(2), png(3) and bmp(6)."); }



Additional testing makes this seem even more odd. fileperms() returns
33279 which is -rwxrwxrwx

a mime-type command I have correctly returns "image/jpeg"

but getimagesize is returning blank. when i hit it with print_r I get
nothing

And all of the 3 above commands are being handed the same address.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:34 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0