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 8968125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:24:01+00:00 2026-06-15T17:24:01+00:00

In trying to simply thumbnail an image in PHP I used: $image = new

  • 0

In trying to simply thumbnail an image in PHP I used:

$image = new Gmagick('/tmp/large.jpg');
$image->thumbnailImage(0, 100);
$image->writeImage('/tmp/small.jpg');

which ran in about 15 seconds.

I then tried:

exec('gm convert -size 200x100 /tmp/large.jpg -resize 200x100 +profile "*" /tmp/small.jpg');

which ran in less than one second.

Can someone explain why, in as much detail as possible? Also, are there any reasons I “shouldn’t” use the second method? Or is there a way to make the gmagick extension faster?

Version details:

gmagick – 1.1.0RC3
GraphicsMagick – GraphicsMagick 1.3.17 2012-10-13 Q8

  • 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-15T17:24:03+00:00Added an answer on June 15, 2026 at 5:24 pm

    I figured out that the ‘-size’ option isn’t part of the php thumbnailing method. Once I added it manually, the following php code actually ran slightly faster than the command line.

    $image = new Gmagick();
    $image->setSize(200,200);    // This sets the size of the canvas. Should be roughly twice the dimensions of the desired thumbnail for antialiasing to work well.
    $image->readImage('/tmp/large.jpg');
    $image->thumbnailImage(0, 100);
    $image->writeImage('/tmp/small.jpg');
    

    This post helped quite a bit.

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

Sidebar

Related Questions

I'm simply trying to crop a JPEG image (no scaling) using PHP. Here is
I am new to libgdx , and am trying to render (thumbnail-sized) images of
I'm trying to do a simple thumbnail generation from an image that isn't located
I am trying to simply multiply a matrix to an image an get an
I simply trying (in vain) to remove all instances of the word 'at' during
I'm simply trying to convert a CGEventTimestamp (which is an unsigned 64-bit integer roughly
I am simply trying to draw a rectangle inside of a panel using flex4.
I am simply trying to display a users location on a map, I am
I am trying to simply add a Google Search bar onto my own map
I'm trying to simply remove all nested li elements within ul , but it

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.