There is a way to check with a \"IF\" if a function fails in php?
Ex.
If (getimagesize($image) returns and error) { ec
Whatever the condition is on an "if" statement (what's inside the parenthesis) will return "true" or "false". If the condition returns "true", the first statement will be executed, otherwise the second statement will get executed.
You can put this, error_reporting(E_ALL); at the very top of your script, right after your opening php tag, to see what error you get.
Hope it helps.
Maybe something like this:
if the function or statement you run inside the "if" or "else" fails, at least you know which one was it based on the result, and the error_reporting might tell you why it failed.