Jump to content
xisto Community
Sign in to follow this  
electron

Detect Image Resolution Without Gd Also stop error if not found

Recommended Posts

Hi, I have come accross some starnge problem in PHP.I wanted to detect the image resolution in of a URL specified by the user.This is possible via getimagesize() function of PHP that is independent of GD library.But this function generates a E_WARNING Error if the image is not there.What shall i do to stop this warning ??I dont want to show the Error in PHP style but my style of error reporting.Please help me.

Share this post


Link to post
Share on other sites

First run an if statement to check for the existance of the image. If it doesn't exist, output to the user that they made a mistake and the address to the image is incorrect. Make sure that you kill the script after you output your nicer error, or it will still try and get the image size.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.