We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

How to validate the image dimension of certain range?

jay28lee
jay28lee asked
on
Medium Priority
323 Views
Last Modified: 2013-12-25
I have a preset image variable $maxwidth and $maxheight of 110 and 176 pixels.

I managed to obtain the image dimension in the variable of $width and $height.

176 / 110 is equal to 1.6

I would like to validate an image using a variable $acceptable so that $height / $width is within the range of 1.58 ~ 1.62.

$acceptable will be equal to 1 if the image aspect ratio is within 1.58 ~ 1.62, or else 0 will be assigned.

I need this short piece of coding for validation.
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.