diff -urNp img_assist/img_assist.css img_assist.patched/img_assist.css --- img_assist/img_assist.css 2006-05-04 14:35:40.000000000 -0700 +++ img_assist.patched/img_assist.css 2006-11-28 09:18:50.000000000 -0800 @@ -118,9 +118,14 @@ span.right { float: right; margin: 5px 0px 5px 5px; } +span.center { + display: block; + margin-left: auto; + margin-right: auto; +} span.caption { display: block; /* put the caption under the image (not next to it) */ } .inline img{ border: 1px solid #000; /* put a thin border around inline images */ -} \ No newline at end of file +} diff -urNp img_assist/img_assist.module img_assist.patched/img_assist.module --- img_assist/img_assist.module 2006-06-16 10:33:15.000000000 -0700 +++ img_assist.patched/img_assist.module 2006-11-28 09:26:37.000000000 -0800 @@ -87,7 +87,7 @@ function img_assist_menu($may_cache) { * Implementation of hook_perm(). */ function img_assist_perm() { - return array('access img_assist', 'access all images', 'access advanced options'); + return array('access img_assist', 'access all images', 'access advanced options', 'use original size'); } /** @@ -725,6 +725,7 @@ function img_assist_properties() { $node->title = str_replace("\n", ' ', trim($node->title)); $node->body = str_replace("\r", ' ', strip_tags($node->body)); $node->body = str_replace("\n", ' ', trim($node->body)); + $image_info = image_get_info(file_create_path($node->images['_original'])); // Select (or generate) a preview image $img_assist_create_derivatives = variable_get('img_assist_create_derivatives', array()); @@ -769,6 +770,13 @@ function img_assist_properties() { } } + // Add a choice for 'original' if it's within the maximum size and user has proper permission + if (user_access('use original size')) { + if ($image_info['width'] <= $max_size[0] && $image_info['height'] <= $max_size[1]) { + $derivatives[$image_info['width'] .'x' . $image_info['height']] = t('original'); + } + } + // Add a choice for 'other' if the user has the proper permission to create custom sizes if ($img_assist_create_derivatives['custom_advanced'] && user_access('access advanced options')) { $derivatives['other'] = t('other'); @@ -823,7 +831,7 @@ function img_assist_properties() { // Size $form[] = array('#value'=>"\n"); $form[] = array('#value'=>"
\n"); - $form[] = array('#value'=>"\n"); + $form[] = array('#value'=>"\n"); $form['size_label'] = array( '#type' => 'select', '#default_value' => variable_get('img_assist_default_label', '100x100'), @@ -854,7 +862,7 @@ function img_assist_properties() { '#type' => 'select', '#title' => t('Alignment'), '#default_value' => variable_get('img_assist_default_alignment', 'left'), - '#options' => array('left'=>'left', 'right'=>'right'), + '#options' => array('left'=>'left', 'right'=>'right', 'none'=>'none', 'center'=>'center'), '#prefix' => '', '#suffix' => '' ); @@ -1262,7 +1270,11 @@ function theme_img_assist_inline($node, $node->title = strip_tags($caption); // change the node title because img_assist_display() uses the node title for alt and title $img_tag = img_assist_display($node, $size); - $output = ""; + if ( $attributes['align'] == "center" ) { + $output = ""; + } else { + $output = ""; + } $link = explode(',', $attributes['link']); if ($link[0] == 'node') { @@ -1648,4 +1660,4 @@ function theme_img_assist_legacy() { return "
\n \"%alt\"\n
%caption
\n
"; } -?> \ No newline at end of file +?>