Back to the snippets index

Path - find automaticaly ( Anthony 15/6/2008 )

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

IM code:

// In my case $HTTP_ENV_VARS['PATH'] = bin:usr/bin
$env_vars explode( \':\', $HTTP_ENV_VARS['PATH']);

// Combine the required part from $HTTP_ENV_VARS[\'PATH\'] and convert for your path.
$env_path = $env_vars[1]."/convert";

// Now $env_path = usr/bin/convert
// Use like:
exec("$env_path input.jpg -resize 100x100 output.jpg");

Batch file - windows server
Fonts installed
Fonts Installed view
Gravity option
http image source
Image information
New image size in variable
Path - find automaticaly
Path to Imagemagick
Setup Information
Shell script
Variables in the code
Version of Imagemagick installed
Writing IM code