You are here

function imageapi_imagemagick_settings_form in ImageAPI 6

Same name and namespace in other branches
  1. 5 imageapi_imagemagick.module \imageapi_imagemagick_settings_form()

Settings form for the toolkit.

File

./imageapi_imagemagick.module, line 20
ImageMagick toolkit functions

Code

function imageapi_imagemagick_settings_form() {
  $form['imageapi_imagemagick_quality'] = array(
    '#type' => 'textfield',
    '#title' => t('Compression Quality'),
    '#description' => t('Ranges from 0 to 100. Higher values mean better image quality, but bigger files.'),
    '#size' => 10,
    '#maxlength' => 3,
    '#default_value' => variable_get('imageapi_imagemagick_quality', 75),
    '#field_suffix' => '%',
    '#element_validate' => array(
      'imageapi_imagemagick_quality_element_validate',
    ),
  );
  $form['imageapi_imagemagick_binary'] = array(
    '#type' => 'fieldset',
    '#title' => t('ImageMagick Binary'),
    '#collapsible' => FALSE,
    '#description' => t('ImageMagick is a standalone program used to manipulate images. To use it, it must be installed on your server and you need to know where it is located. If you are unsure of the exact path consult your ISP or server administrator.'),
  );
  $form['imageapi_imagemagick_binary']['version'] = array(
    '#weight' => -1,
  );
  $form['imageapi_imagemagick_binary']['#after_build'] = array(
    '_imageapi_imagemagick_build_version',
  );
  $form['imageapi_imagemagick_binary']['imageapi_imagemagick_convert'] = array(
    '#type' => 'textfield',
    '#title' => t('Path to the "convert" binary'),
    '#default_value' => variable_get('imageapi_imagemagick_convert', '/usr/bin/convert'),
    '#required' => TRUE,
    '#description' => t('Specify the complete path to the ImageMagic <kbd>convert</kbd> binary. For example: <kbd>/usr/bin/convert</kbd> or <kbd>C:\\Program Files\\ImageMagick-6.3.4-Q16\\convert.exe</kbd>'),
    '#element_validate' => array(
      'imageapi_imagemagick_validate_path',
    ),
  );
  $form['imageapi_imagemagick_binary']['imageapi_imagemagick_debugging'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display debugging information'),
    '#default_value' => variable_get('imageapi_imagemagick_debugging', 0),
    '#description' => t('Checking this option will display the ImageMagick commands and output to users with the <em>administer site configuration</em> permission.'),
    '#weight' => 2,
  );
  return system_settings_form($form);
}