? .imageapi_imagemagick.module.swp
Index: imageapi.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi.info,v
retrieving revision 1.2
diff -u -p -r1.2 imageapi.info
--- imageapi.info	21 Feb 2008 11:21:05 -0000	1.2
+++ imageapi.info	21 Apr 2008 20:27:53 -0000
@@ -2,3 +2,5 @@
 name = ImageAPI
 description = ImageAPI supporting multiple toolkits.
 package = ImageCache
+core = 6.x
+php = 5.2
Index: imageapi.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi.module,v
retrieving revision 1.14
diff -u -p -r1.14 imageapi.module
--- imageapi.module	21 Apr 2008 12:54:38 -0000	1.14
+++ imageapi.module	21 Apr 2008 20:27:53 -0000
@@ -4,55 +4,53 @@
 /**
  * @file
  *
- * An ImageAPI supporting additional image plugins as modules. 
+ * An ImageAPI supporting additional image plugins as modules.
  * Images are treated as objects, and images are not written per
  * manipulation as Drupal's core image handling works.
- * 
- * 
- * imageapi image api workflow... 
+ *
+ *
+ * imageapi image api workflow...
  * $image = imageapi_image_open($path) to get an image object for $path...
  * image_X($image, $arg1, $arg2)  to manipulate image object...
  * imageapi_image_close($image) to overwrite original image.
- * 
+ *
  */
 
-define('IMAGEAPI_MINIMUM_PHP', '5.2');
-function imageapi_menu($may_cache) {
+function imageapi_menu() {
   $items = array();
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/imageapi',
-      'title' => t('ImageAPI'),
-      'description' => t('Configure ImageAPI.'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('imageapi_settings'),
+  $items['admin/settings/imageapi'] = array(
+    'title' => 'ImageAPI',
+    'description' => 'Configure ImageAPI.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('imageapi_settings'),
+    'access arguments' => array('administer imageapi'),
+  );
+
+  $toolkits = imageapi_get_available_toolkits();
+  if ($toolkits) {
+    $items['admin/settings/imageapi/list'] = array(
+      'title' => 'List',
+      'type' => MENU_DEFAULT_LOCAL_TASK,
+      'weight' => -1,
     );
-  }
-  else {
-    $toolkits = imageapi_get_available_toolkits();
-    if ($toolkits) {
-      $items[] = array(
-        'path' => 'admin/settings/imageapi/list',
-        'title' => 'List',
-        'type' => MENU_DEFAULT_LOCAL_TASK,
-        'weight' => -1,
-      );
-      $items[] = array(
-        'path' => 'admin/settings/imageapi/config',
-        'title' => 'Configure',
-        'type' => MENU_LOCAL_TASK,
-        'callback' => 'drupal_get_form',
-        'callback arguments' => array(imageapi_default_toolkit() .'_settings_form'),
-      );
-      foreach ($toolkits as $module => $info) {
-        $items[] = array(
-          'path' => 'admin/settings/imageapi/config/'. $module,
+    $items['admin/settings/imageapi/config'] = array(
+      'title' => 'Configure',
+      'type' => MENU_LOCAL_TASK,
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array(imageapi_default_toolkit() .'_settings_form'),
+      'access arguments' => array('administer imageapi'),
+    );
+    foreach ($toolkits as $module => $info) {
+      if (function_exists($module .'_settings_form')) {
+        $items['admin/settings/imageapi/config/'. $module] = array(
           'title' => $info['name'],
-          'callback' => 'drupal_get_form',
-          'callback arguments' => array($module .'_settings_form'),
+          'page callback' => 'drupal_get_form',
+          'page arguments' => array($module .'_settings_form'),
+          'access arguments' => array('administer imageapi'), 
           'type' => $module == imageapi_default_toolkit() ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
         );
       }
+      else {dsm("mssing"); }
     }
   }
   return $items;
@@ -67,16 +65,16 @@ function imageapi_settings() {
     case 0:
       $form['imageapi_toolkits']['#value'] = t('There are no image toolkit modules enabled. Toolkit modules can be enabled from the <a href="!admin-build-modules">module configuration page</a>.', array('!admin-build-modules' => url('admin/build/modules')));
       return $form;
-    
+
     case 1:
       $toolkit = key($toolkits);
-      // The variable needs to be manually set. Otherwise, if a user has two 
-      // toolkits and disables the selected one they won't be able to select the 
+      // The variable needs to be manually set. Otherwise, if a user has two
+      // toolkits and disables the selected one they won't be able to select the
       // remaing toolkit.
       variable_set('imageapi_image_toolkit', $toolkit);
       $form['imageapi_image_toolkit']['#value'] = t('The %toolkit module is the only enabled image toolkit. Drupal will use it for resizing, cropping and other image manipulations.', array('%toolkit' => $toolkits[$toolkit]['name']));
       return $form;
-            
+
     default:
       $options = array();
       foreach ($toolkits as $module => $info) {
@@ -97,29 +95,29 @@ function imageapi_settings() {
 /**
  * Return a list of available toolkits.
  *
- * @return 
+ * @return
  *   An array of the enabled image toolkit modules. The module name is the key
- *   and the value is a sub-array with the module's 'name' and 'description'.  
+ *   and the value is a sub-array with the module's 'name' and 'description'.
  */
 function imageapi_get_available_toolkits() {
   static $toolkits;
- 
+
   if (!isset($toolkits)) {
     $toolkits = array();
-    foreach (module_implements('imageapi_toolkit', true) as $module) {
-      $info = _module_parse_info_file(drupal_get_path('module', $module) .'/'. $module .'.info');
+    foreach (module_implements('imageapi_toolkit', TRUE) as $module) {
+      $info = drupal_parse_info_file(drupal_get_path('module', $module) .'/'. $module .'.info');
       $toolkits[$module] = array('name' => $info['name'], 'description' => $info['description']);
     }
   }
-  
+
   return $toolkits;
 }
 
 /**
  * Retrieve the name of the currently used toolkit.
  *
- * @return 
- *   String containing the name of the toolkit, or false if none is available.
+ * @return
+ *   String containing the name of the toolkit, or FALSE if none is available.
  */
 function imageapi_default_toolkit() {
   $toolkit = variable_get('imageapi_image_toolkit', 'imageapi_gd');
@@ -151,7 +149,7 @@ function imageapi_image_scale_and_crop(&
   $scale = max($width / $image->info['width'], $height / $image->info['height']);
   $x = round(($image->info['width'] * $scale - $width) / 2);
   $y = round(($image->info['height'] * $scale - $height) / 2);
- 
+
   if (imageapi_image_resize($image, $image->info['width'] * $scale, $image->info['height'] * $scale)) {
     return imageapi_image_crop($image, $x, $y, $width, $height);
   }
@@ -188,10 +186,10 @@ function imageapi_image_scale(&$image, $
   else {
     $width = (int) round($height / $aspect);
   }
-  
+
   return call_user_func($image->toolkit .'_image_resize', $image, $width, $height);
 }
- 
+
 /**
  * Resize an image to the given dimensions (ignoring aspect ratio).
  *
@@ -212,7 +210,7 @@ function imageapi_image_scale(&$image, $
 function imageapi_image_resize(&$image, $width, $height) {
   return call_user_func($image->toolkit .'_image_resize', $image, $width, $height);
 }
- 
+
 /**
  * Rotate an image by the given number of degrees.
  *
@@ -223,8 +221,8 @@ function imageapi_image_resize(&$image, 
  * @param $degrees
  *   The number of (clockwise) degrees to rotate the image.
  * @param $bg_color
- *   An hexidecimal integer specifying the background color to use for the 
- *   uncovered area of the image after the rotation. E.g. 0x000000 for black, 
+ *   An hexidecimal integer specifying the background color to use for the
+ *   uncovered area of the image after the rotation. E.g. 0x000000 for black,
  *   0xff00ff for magenta, and 0xffffff for white.
  * @param $toolkit
  *   An optional override of the default image toolkit.
@@ -234,7 +232,7 @@ function imageapi_image_resize(&$image, 
 function imageapi_image_rotate(&$image, $degrees, $bgcolor = 0x000000) {
   return call_user_func($image->toolkit .'_image_rotate', $image, $degrees, $bgcolor);
 }
- 
+
 /**
  * Crop an image to the rectangle specified by the given rectangle.
  *
@@ -248,13 +246,13 @@ function imageapi_image_rotate(&$image, 
  *   The target width in pixels.
  * @param $height
  *   The target height in pixels.
- * @return 
+ * @return
  *   modifed image object.
  */
 function imageapi_image_crop(&$image, $x, $y, $width, $height) {
   return call_user_func($image->toolkit .'_image_crop', $image, $x, $y, $width, $height);
 }
- 
+
 
 function imageapi_image_desaturate(&$image) {
   return call_user_func($image->toolkit .'_image_desaturate', $image);
@@ -273,8 +271,8 @@ function imageapi_image_open($file, $too
       return $image;
     }
   }
-  watchdog('imageapi', t('ImageAPI failed to open %file with %toolkit', array('%file' => $file, '%toolkit' => $toolkit)), WATCHDOG_WARNING);
-  return false;
+  watchdog('imageapi', 'ImageAPI failed to open %file with %toolkit', array('%file' => $file, '%toolkit' => $toolkit), WATCHDOG_WARNING);
+  return FALSE;
 }
 
 /**
@@ -295,13 +293,12 @@ function imageapi_image_close($image, $d
     if (@chmod($destination, 0775)) {
       return $return;
     } 
-    watchdog('imageapi', t('Could not set permissons on destination file: %file', array('%file' => $destination)));
+    watchdog('imageapi', 'Could not set permissons on destination file: %file', array('%file' => $destination));
   }
   return false;
 }
 
 
-
 /**
  * Convert a hex string to it's rgba integer components
  * $hex can be in the formats: '#ABC','ABC','#ABCD','ABCD','#AABBCC','AABBCC','#AABBCCDD','AABBCCDD'
Index: imageapi_gd.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_gd.info,v
retrieving revision 1.2
diff -u -p -r1.2 imageapi_gd.info
--- imageapi_gd.info	21 Feb 2008 11:21:05 -0000	1.2
+++ imageapi_gd.info	21 Apr 2008 20:27:53 -0000
@@ -2,4 +2,5 @@
 name = ImageAPI GD2
 description = Uses PHP's built-in GD2 image processing support.
 package = ImageCache
-dependencies = imageapi
+dependencies[] = imageapi
+core = 6.x
Index: imageapi_gd.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_gd.module,v
retrieving revision 1.6
diff -u -p -r1.6 imageapi_gd.module
--- imageapi_gd.module	21 Apr 2008 12:54:38 -0000	1.6
+++ imageapi_gd.module	21 Apr 2008 20:27:53 -0000
@@ -51,8 +51,7 @@ function imageapi_gd_image_crop(&$image,
   $image->res = $res;
   $image->info['width'] = $width;
   $image->info['height'] = $height;
-  return true;
-  
+  return TRUE;
 }
 
 function imageapi_gd_image_resize(&$image, $width, $height) {
@@ -98,7 +97,7 @@ function imageapi_gd_image_rotate(&$imag
   $res = imagerotate($image->res, $degrees, $bgcolor);
   imagedestroy($image->res);
   $image->res = $res;
-  return true;
+  return TRUE;
 } 
 
 function imageapi_gd_image_desaturate(&$image) {
Index: imageapi_imagemagick.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_imagemagick.info,v
retrieving revision 1.1
diff -u -p -r1.1 imageapi_imagemagick.info
--- imageapi_imagemagick.info	2 Apr 2008 06:48:17 -0000	1.1
+++ imageapi_imagemagick.info	21 Apr 2008 20:27:53 -0000
@@ -2,4 +2,6 @@
 name = ImageAPI ImageMagick
 description = Command Line ImageMagick support.
 package = ImageCache
-dependencies = imageapi
+dependencies[] = imageapi
+core = 6.x
+
Index: imageapi_imagemagick.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_imagemagick.module,v
retrieving revision 1.9
diff -u -p -r1.9 imageapi_imagemagick.module
--- imageapi_imagemagick.module	21 Apr 2008 12:54:38 -0000	1.9
+++ imageapi_imagemagick.module	21 Apr 2008 20:27:53 -0000
@@ -26,7 +26,7 @@ function imageapi_imagemagick_settings_f
     '#maxlength' => 3,
     '#default_value' => variable_get('imageapi_imagemagick_quality', 75),
     '#field_suffix' => '%',
-    '#validate' => array('imageapi_imagemagick_quality_element_validate' => array()),
+    '#element_validate' => array('imageapi_imagemagick_quality_element_validate'),
   );
   
   $form['imageapi_imagemagick_binary'] = array(
@@ -45,7 +45,7 @@ function imageapi_imagemagick_settings_f
     '#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>'),
-    '#validate' => array('_imageapi_imagemagick_validate_path' => array()),
+    '#element_validate' => array('imageapi_imagemagick_validate_path'),
   );
 
   $form['imageapi_imagemagick_binary']['imageapi_imagemagick_debugging'] = array(
@@ -53,13 +53,15 @@ function imageapi_imagemagick_settings_f
     '#title' => t('Display debugging information'),
     '#default_value' => variable_get('imageapi_imagemagick_debugging', 0),
     '#description' => t('Checking this option will display the ImageMagick commands and ouput to users with the <em>administer site configuration</em> permission.'),
+    '#weight' => 2,
   );
+
   return system_settings_form($form);
 }
 
-function _imageapi_imagemagick_build_version($form_element, $form_values) {
+function _imageapi_imagemagick_build_version($form_element, $form_state) {
   // make sure path is set and valid before running after build.
-  if ($path_errors = _imageapi_imagemagick_check_path($form_values['imageapi_imagemagick_convert'])) {
+  if ($path_errors = _imageapi_imagemagick_check_path($form_state['values']['imageapi_imagemagick_convert'])) {
     // check here is primarily for pre-existing bad settings...
     // the #validate should prevent users from adding bad paths.
     $form_element['imageapi_imagemagick_binary'] = array(
@@ -79,7 +81,7 @@ function _imageapi_imagemagick_build_ver
   return $form_element;
 }
 
-function _imageapi_imagemagick_validate_path($element) {
+function imageapi_imagemagick_validate_path($element) {
   if ($errors = _imageapi_imagemagick_check_path($element['#value'])) {
     form_set_error($element['#parents'][0], implode('<br />', $errors));
     //form_set_value($element['#parents'][0], variable_get('imageapi_imagemagick_convert', '/usr/bin/convert'));
Index: imageapi_imagick.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_imagick.info,v
retrieving revision 1.2
diff -u -p -r1.2 imageapi_imagick.info
--- imageapi_imagick.info	21 Feb 2008 11:21:05 -0000	1.2
+++ imageapi_imagick.info	21 Apr 2008 20:27:53 -0000
@@ -2,4 +2,5 @@
 name = ImageAPI Imagick
 description = Experimental Imagick PHP extension image processing support.
 package = ImageCache
-dependencies = imageapi
+dependencies[] = imageapi
+core = 6.x
Index: imageapi_imagick.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_imagick.module,v
retrieving revision 1.4
diff -u -p -r1.4 imageapi_imagick.module
--- imageapi_imagick.module	30 Mar 2008 23:16:45 -0000	1.4
+++ imageapi_imagick.module	21 Apr 2008 20:27:53 -0000
@@ -51,7 +51,7 @@ function imageapi_imagick_image_open($im
 
 function imageapi_imagick_image_close($image, $destination) {
   try {
-   return $image->res->writeImage($destination);
+    return $image->res->writeImage($destination);
   }
   catch(Exception $e) {
     //print_r($e);
