Index: img_assist.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/img_assist.module,v retrieving revision 1.75.2.23 diff -u -p -r1.75.2.23 img_assist.module --- img_assist.module 1 Feb 2009 09:59:57 -0000 1.75.2.23 +++ img_assist.module 2 Feb 2009 02:26:57 -0000 @@ -877,7 +877,8 @@ function img_assist_properties_form($for require_once drupal_get_path('module', 'img_assist') .'/includes/img_assist.token.inc'; $image_info = image_get_info(file_create_path($node->images[IMAGE_ORIGINAL])); - + $image_info['aspect_ratio'] = $image_info['height'] / $image_info['width']; + // Select (or generate) a preview image. $img_assist_create_derivatives = variable_get('img_assist_create_derivatives', array()); if (!empty($img_assist_create_derivatives['properties'])) { @@ -915,7 +916,11 @@ function img_assist_properties_form($for // choose. $max_size = explode('x', variable_get('img_assist_max_size', '640x640')); - foreach (image_get_sizes() as $key => $size) { + foreach (image_get_sizes(NULL, $image_info['aspect_ratio']) as $key => $size) { + // Sizes are strings, may contain '' for 0; convert to integers. + settype($size['width'], 'int'); + settype($size['height'], 'int'); + $added_to_derivatives = FALSE; if ($key == IMAGE_ORIGINAL) { if (user_access('use original size') && $image_info['width'] <= $max_size[0] && $image_info['height'] <= $max_size[1]) {