Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7823425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:14:32+00:00 2026-06-02T08:14:32+00:00

What is a fast way to tell what dimensions an Imagick instance will become

  • 0

What is a fast way to tell what dimensions an Imagick instance will become when you call Imagick::thumbnailImage($w, $h) on it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T08:14:35+00:00Added an answer on June 2, 2026 at 8:14 am

    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 $w or $h are 0, etc.) So, I made this function:

    function thumbSize($pic, $thumbW, $thumbH) {
        //make a white image of the same size
        $picsize = $pic->getImageGeometry();
        $whitepic=new Imagick();
        $whitepic->newImage($picsize['width'], $picsize['height'], "white");
        $whitepic->thumbnailImage($thumbW, $thumbH);
        return $whitepic->getImageGeometry();
    }
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a fast way to count the number of bits in an integer
Is there a fast way to count the amount of successive null bytes starting
Which is the fast way to write text file in java? At the moment
I need to check in some fast way if there is any text nodes
I'm looking for a fast way in C# to find all dates in a
I'm working with Android and I really need a fast way to get a
I'm having a little trouble figuring out a fast way to accomplish a (seemingly)
Is there a fast/efficiency way to check if a table is empty? DECLARE @StartEndTimes
Can someone suggest a fast 2 way encryption algorithm for long ints? My candidates
I have read that CURL is way too fast than File Get Contents and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.