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	29 Apr 2008 19:37:37 -0000
@@ -2,3 +2,5 @@
 name = ImageAPI
 description = ImageAPI supporting multiple toolkits.
 package = ImageCache
+core = 6.x
+php = 5.2
Index: imageapi.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi.install,v
retrieving revision 1.3
diff -u -p -r1.3 imageapi.install
--- imageapi.install	21 Apr 2008 12:54:38 -0000	1.3
+++ imageapi.install	29 Apr 2008 19:37:37 -0000
@@ -1,34 +1,13 @@
 <?php
 // $Id: imageapi.install,v 1.3 2008/04/21 12:54:38 dopry Exp $
 
-/**
- *  Implementation of hook_requirements().
- */
-function imageapi_requirements($phase) {
-  $requirements = array();
-  // Ensure translations don't break at install time
-  $t = get_t();
-
-  if (version_compare(phpversion(), IMAGEAPI_MINIMUM_PHP) < 0) {
-    $requirements['imageapi_php'] = array(
-      'title' => $t('ImageAPI PHP'),
-      'description' => $t('ImageAPI requires at least PHP %version.', array('%version' => IMAGEAPI_MINIMUM_PHP)),
-      'severity' => REQUIREMENT_ERROR
-    );
-  }
-  
-  return $requirements;
-}
-
-
 function imageapi_install() {
 }
 
+/**
+ * Implementation of hook_uninstall().
+ *
+ */
 function imageapi_uninstall() {
-}
-
-function imageapi_enable() {
-}
-
-function imageapi_disable() {
+  variable_del('imageapi_image_toolkit');
 }
Index: imageapi.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi.module,v
retrieving revision 1.15
diff -u -p -r1.15 imageapi.module
--- imageapi.module	24 Apr 2008 05:24:34 -0000	1.15
+++ imageapi.module	29 Apr 2008 19:37:37 -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,28 +95,28 @@ 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');
+      $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 
+ * @return
  *   String containing the name of the toolkit, or false if none is available.
  */
 function imageapi_default_toolkit() {
@@ -127,6 +125,10 @@ function imageapi_default_toolkit() {
   if (isset($toolkit) && module_exists($toolkit)) {
     return $toolkit;
   }
+  // If it's not fall back to first available toolist.
+  foreach (imageapi_get_available_toolkits() as $toolkit => $info) {
+    return $toolkit;
+  }
   return false;
 }
 
@@ -155,7 +157,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);
   }
@@ -197,10 +199,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).
  *
@@ -221,7 +223,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.
  *
@@ -232,8 +234,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.
@@ -243,7 +245,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.
  *
@@ -257,7 +259,7 @@ 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) {
@@ -267,7 +269,7 @@ function imageapi_image_crop(&$image, $x
 
   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);
@@ -286,7 +288,7 @@ 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);
+  watchdog('imageapi', 'ImageAPI failed to open %file with %toolkit', array('%file' => $file, '%toolkit' => $toolkit), WATCHDOG_WARNING);
   return false;
 }
 
@@ -308,13 +310,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	29 Apr 2008 19:37:37 -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.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_gd.install,v
retrieving revision 1.3
diff -u -p -r1.3 imageapi_gd.install
--- imageapi_gd.install	21 Apr 2008 12:54:38 -0000	1.3
+++ imageapi_gd.install	29 Apr 2008 19:37:37 -0000
@@ -60,3 +60,10 @@ function imageapi_gd_requirements($phase
   }
   return $requirements;
 }
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function imageapi_gd_uninstall() {
+  variable_del('imageapi_jpeg_quality');
+}
\ No newline at end of file
Index: imageapi_gd.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imageapi/imageapi_gd.module,v
retrieving revision 1.7
diff -u -p -r1.7 imageapi_gd.module
--- imageapi_gd.module	24 Apr 2008 06:46:35 -0000	1.7
+++ imageapi_gd.module	29 Apr 2008 19:37:37 -0000
@@ -18,13 +18,13 @@ function imageapi_gd_imageapi_toolkit() 
  * Settings form for the toolkit.
  */
 function imageapi_gd_settings_form() {
-  $form['image_jpeg_quality'] = array(
+  $form['imageapi_jpeg_quality'] = array(
     '#type' => 'textfield',
     '#title' => t('JPEG quality'),
     '#description' => t('Define the image quality for JPEG manipulations. Ranges from 0 to 100. Higher values mean better image quality, but bigger files.'),
     '#size' => 10,
     '#maxlength' => 3,
-    '#default_value' => variable_get('image_jpeg_quality', 75),
+    '#default_value' => variable_get('imageapi_jpeg_quality', 75),
     '#field_suffix' => '%',
   );
   return system_settings_form($form);
@@ -104,7 +104,7 @@ function _gd_close($res, $destination, $
     return false;
   }
   if ($extension == 'jpeg') {
-    return $close_func($res, $destination, variable_get('image_jpeg_quality', 75));
+    return $close_func($res, $destination, variable_get('imageapi_jpeg_quality', 75));
   }
   else {
     return $close_func($res, $destination);
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	29 Apr 2008 19:37:37 -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.10
diff -u -p -r1.10 imageapi_imagemagick.module
--- imageapi_imagemagick.module	23 Apr 2008 01:36:08 -0000	1.10
+++ imageapi_imagemagick.module	29 Apr 2008 19:37:37 -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'));
@@ -170,7 +172,7 @@ function _imageapi_imagemagick_check_pat
 function _imageapi_imagemagick_convert_exec($command_args, &$output, &$errors) {
   $convert_path = variable_get('imageapi_imagemagick_convert', '/usr/bin/convert');
   if ($errors = _imageapi_imagemagick_check_path($convert_path)) {
-    watchdog('imageapi imagemagick', implode('<br />', $errors), WATCHDOG_ERRROR);
+    watchdog('imageapi imagemagick', implode('<br />', $errors), WATCHDOG_ERROR);
     return false;
   }
 
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	29 Apr 2008 19:37:37 -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
