ImageMagick allows you to dynamically create and edit images on the server. It will need to be ran from the command line as none of the API's are installed. ImageMagick is already available for utilization on the servers. It is located at:

  • /usr/bin/convert
  • /usr/bin/mogrify

ImageMagick homepage -http://www.imagemagick.com/

 


Example:
The following are examples to demonstrate that ImageMagick is installed and functioning. If you have a file named image.jpg in your public_html, the following command ran from the command line will resize the image and name the new image to resize_image.jpg:

  • VPS and Dedicated servers with SSH access:
    convert image.jpg -resize 64x64 resize_image.jpg

     

  • Shared servers with no SSH access: You can setup a cron job with the following command:
    /usr/bin/convert public_html/image.jpg -resize 64x64 public_html/resize_image.jpg

     

  • Shared servers with no SSH accesss: You can run the following command from a php script:
    exec('/usr/bin/convert /home/USERNAME/public_html/image.jpg -resize 64x64 /home/USERNAME/public_html/resize_image.jpg');

     

    Please note that in this example you will need to replace USERNAME with your actual username.
    You will also need to make sure that the folder you are writing resize_image.jpg to has write permissions.

Like this Article?
drom95 2013-04-05 2:16 pm
This article is lacking an example using VPS and a command from a php script. Please update.
drom95 2013-04-10 1:12 pm
Additional note: we found after trial and error IM works, it just wasn't converting pdf files which was what we needed. IM requires GhostScript. The VPS server may come with IM installed but you may need to request GS be installed.
johnpaulb-imhs1 Community Support technician 2013-04-10 3:52 pm
Hello drom95,

Thank you for your suggestions, we will update this article as soon as posible.

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm Tim Sisson, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Latest Questions

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Ask a Question!
Recent Questions
  1. we-creation.com server down
  2. How do I delete the DNS entry?
  3. Wordpress Login Temporarily Disabled (again)

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!