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

Home » Imported messages » comp.lang.php » Checking if file is an image
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Checking if file is an image [message #170869 is a reply to message #170859] Sat, 04 December 2010 11:39 Go to previous messageGo to previous message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma:
Senior Member
.oO(Magno)

> ¿Why don’t you just better use ob_start(); and buffer any possible error
> output?

Ugly.

> If no error output, then render the image normally.
> If there is error, let yourself know by any way and then exit();
>
> To check if there is any error, I think that a single.-
> if (strlen($ob = ob_get_clean())) would do.

You could also use your own error handler and handle (almost) all PHP
errors and warnings as exceptions. But this seems to be a bit overkill
in this case.

Micha
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Efficiency of a lot of variables
Next Topic: web solutions for global presence
Goto Forum:
  

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

Current Time: Fri Nov 22 18:16:46 GMT 2024

Total time taken to generate the page: 0.05310 seconds