FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Failed @getimagesize() print to error_log?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Failed @getimagesize() print to error_log? [message #173068 is a reply to message #173067] Sun, 20 March 2011 09:31 Go to previous messageGo to previous message
jwcarlton is currently offline  jwcarlton
Messages: 76
Registered: December 2010
Karma:
Member
> First of all, why are you using '@' to potentially hide errors?  You
> should not be using this; you need error messages displayed on your
> development system.  Rather, disable the displaying of error messages in
> the php.ini of your production system.

Excellent point. I had actually disabled errors in php.ini recently,
anyway, so this was just a leftover from before.


> And yes, a failed getimagesize() obviously writes to the error log.  And
> you won't get a referrer; getimagesize() is completely independent of
> any web server.
>
> is_readable() will help you determine if it's a file and is readable,
> but it won't tell you whether it is a valid image file or not.  But if
> the only files in this directory are image files, you should be ok.
>
> So the question is - does the file exist?  Is it an image file?  You can
> check to see if the file exists with file_exists(), but you can't easily
> tell if it is an image file or not.
>
> If you really need to find out who the referrer is (does it make a
> difference?), check the time of the error message and see what's
> happening at that time in your web server access log.  It should tell
> you more about the request.

I don't really care about the referrer, other than trying to find if I
have a problem on a specific page. I've changed getimagesize() to
is_readable() (you're correct, the only thing in this directory are
images that have been uploaded and tested through my own script, so
that should be fine), but I'm still getting errors in the error_log.

Does a false is_readable() also write to the error_log? Or am I more
likely dealing with these deleted images being found on something like
Google Images?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PDO MySQL
Next Topic: Very strange behaviour of imageftbbox()?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 20:40:49 GMT 2024

Total time taken to generate the page: 0.04482 seconds