What is a fast way to tell what dimensions an Imagick instance will become when you call Imagick::thumbnailImage($w, $h) on it?
What is a fast way to tell what dimensions an Imagick instance will become
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I could not find an algorithm for finding the dimensions that
Imagick::thumbnailImage($w, $h)gives that handles all possible situations with 100% accuracy. (e.g. cases where$wor$hare0, etc.) So, I made this function:Sadly, it has to resize an image to work; it is many times slower than an algorithm-based solution. But it works.
If anyone else has a better answer, I’ll check it instead.