### Eclipse Workspace Patch 1.0 #P Image Assist 5.1.7 Index: img_assist.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/img_assist.js,v retrieving revision 1.4.2.5 diff -u -r1.4.2.5 img_assist.js --- img_assist.js 19 Nov 2007 02:27:49 -0000 1.4.2.5 +++ img_assist.js 14 Jan 2009 01:32:18 -0000 @@ -64,13 +64,16 @@ var aspect = formObj['edit-aspect'].value; var width = size[0]; var height = size[1]; - if (Math.round(width / aspect) <= height) { - // width is controlling factor - height = Math.round(width / aspect); - } - else { - // height is controlling factor - width = Math.round(height * aspect); + // Bypass checks on the orginal + if (!formObj['edit-original-size'].value && formObj['edit-original-size'].value != formObj['edit-size-label'].value) { + if (Math.round(width / aspect) <= height) { + // width is controlling factor + height = Math.round(width / aspect); + } + else { + // height is controlling factor + width = Math.round(height * aspect); + } } // fill the hidden width and height textboxes with these values formObj['edit-width'].value = width; Index: img_assist.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/img_assist.module,v retrieving revision 1.68.2.51 diff -u -r1.68.2.51 img_assist.module --- img_assist.module 16 Aug 2008 20:41:40 -0000 1.68.2.51 +++ img_assist.module 14 Jan 2009 01:32:20 -0000 @@ -804,12 +804,12 @@ // snap to the nearest standard size. You can create any arbitrary size you // choose. $max_size = explode('x', variable_get('img_assist_max_size', '640x640')); - + $orginal_size = FALSE; foreach (image_get_sizes() as $key => $size) { $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]) { - $derivatives[$image_info['width'] .'x'. $image_info['height']] = $size['label']; + $derivatives[$orginal_size = $image_info['width'] .'x'. $image_info['height']] = $size['label']; $added_to_derivatives = TRUE; } } @@ -885,6 +885,10 @@ '#options' => $derivatives, '#attributes' => array('onchange' => 'parent.onChangeSizeLabel()'), ); + $form['original_size'] = array( + '#type' => 'hidden', + '#value' => $orginal_size ? $orginal_size : 0, + ); $form[] = array('#value' => '
'); $form['width'] = array( '#type' => 'textfield',