Snippets - Utilities

Snippets index page

NOTE: Most of the IM snippets have been tested on IM version 6.3.5 There may be some differences if you are using the code on other versions.

Path - find automaticly - Anthony 15/6/2008

This will find the path to convert etc. automaticaly. But may not work on all setups.

  1. <?php
  2. // In my case $HTTP_ENV_VARS[\'PATH\'] = bin:usr/bin
  3. $env_vars explode( :, $HTTP_ENV_VARS[PATH]);
  4. // Combine the required part from $HTTP_ENV_VARS[\'PATH\'] and convert for your path.
  5. $env_path $env_vars[1]."/convert";
  6. // Now $env_path = usr/bin/convert
  7. // Use like:
  8. exec("$env_path input.jpg -resize 100x100 output.jpg");
  9. ?>

For more examples and information check out the main Imagemagick section.

Batch file View

Fonts installed View

Fonts Installed view View

Gravity option View

http image source View

Image information View

New image size in variable View

Path - find automaticly View

Path to Imagemagick View

Setup Information View

Shell script View

Variables in the code View

Version of Imagemagick installed View

Writing IM code View