Index: imagemagick.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagemagick/imagemagick.module,v
retrieving revision 1.7
diff -u -p -r1.7 imagemagick.module
--- imagemagick.module	30 Jan 2011 18:58:52 -0000	1.7
+++ imagemagick.module	30 Jan 2011 19:17:18 -0000
@@ -72,7 +72,7 @@ function image_imagemagick_settings() {
  * Form element validation handler for image quality settings field.
  */
 function imagemagick_element_validate_quality($element, &$form_state) {
-  if ($element['#value'] < 0 || $element['#value'] > 100) {
+  if (!is_numeric($element['#value']) || $element['#value'] < 0 || $element['#value'] > 100) {
     form_error($element, t('!name must be a value between 0 and 100.', array('!name' => $element['#title'])));
   }
 }
@@ -279,7 +279,40 @@ function image_imagemagick_load(stdClass
  * @see image_save()
  */
 function image_imagemagick_save(stdClass $image, $destination) {
-  return _imagemagick_convert($image->source, $destination, $image->ops);
+  return _imagemagick_convert($image->source, drupal_realpath($destination), $image->ops);
+}
+
+/**
+ * Get details about an image.
+ *
+ * @param $image
+ *   An image object.
+ * @return
+ *   FALSE, if the file could not be found or is not an image. Otherwise, a
+ *   keyed array containing information about the image:
+ *   - "width": Width, in pixels.
+ *   - "height": Height, in pixels.
+ *   - "extension": Commonly used file extension for the image.
+ *   - "mime_type": MIME type ('image/jpeg', 'image/gif', 'image/png').
+ *
+ * @see image_get_info()
+ */
+function image_imagemagick_get_info(stdClass $image) {
+  $details = FALSE;
+  $data = getimagesize(drupal_realpath($image->source));
+
+  if (isset($data) && is_array($data)) {
+    $extensions = array('1' => 'gif', '2' => 'jpg', '3' => 'png');
+    $extension = isset($extensions[$data[2]]) ?  $extensions[$data[2]] : '';
+    $details = array(
+      'width'     => $data[0],
+      'height'    => $data[1],
+      'extension' => $extension,
+      'mime_type' => $data['mime'],
+    );
+  }
+
+  return $details;
 }
 
 /**
@@ -301,7 +334,7 @@ function _imagemagick_convert($source, $
 function _imagemagick_convert_exec($command_args, &$output, &$errors) {
   $convert_path = variable_get('imagemagick_convert', '/usr/bin/convert');
   if ($errors = _imagemagick_check_path($convert_path)) {
-    watchdog('imageapi imagemagick', '!errors', array('!errors' => implode('<br />', $errors)), WATCHDOG_ERROR);
+    watchdog('imagemagick', '!errors', array('!errors' => implode('<br />', $errors)), WATCHDOG_ERROR);
     return FALSE;
   }
 
