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 #173069 is a reply to message #173068] Sun, 20 March 2011 12:34 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 3/20/2011 5:31 AM, jwcarlton wrote:
>> 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?

No, IIRC, is_readable() shouldn't write to the error log - but if it
did, you would see a different message in the error log. But no matter
the source, if you're checking to see if the file is readable before
calling getimagesize(), you shouldn't be seeing an error for a
non-existent file.

What is your current error message?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[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: Thu Nov 28 00:04:37 GMT 2024

Total time taken to generate the page: 0.08025 seconds