ImageMagick allows you to dynamically create and edit images on the server. ImageMagick is usually run from the command line, but since command line access is not available on Web Hosting Hub servers, the commands can be ran through cron jobs or PHP scripts instead. ImageMagick programs are located in:
For more information on using ImageMagick, please see the ImageMagick documentation:
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 commands ran through either a cron job or from a PHP script will resize the image and name the new image to resize_image.jpg.
Running ImageMagick from a cron job
Set up a cron job with the following command:
/usr/bin/convert public_html/image.jpg -resize 64x64 public_html/resize_image.jpg
Running ImageMagick from a PHP script
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');
Replace USERNAME with your actual cPanel username (e.g. userna5) and make sure that the folder you are writing the image to has file permissions set to 755.