*** img_assist.module	Sat Jun 17 01:02:00 2006
--- img_assist.module-new	Fri Oct 13 06:54:14 2006
***************
*** 87,93 ****
   * Implementation of hook_perm().
   */
  function img_assist_perm() {
!   return array('access img_assist', 'access all images', 'access advanced options');
  }
  
  /**
--- 87,93 ----
   * Implementation of hook_perm().
   */
  function img_assist_perm() {
!   return array('access img_assist', 'access all images', 'access advanced options', 'use original size');
  }
  
  /**
***************
*** 769,774 ****
--- 769,782 ----
        }
      }
  
+     // Add a choice for 'original' if it's within the maximum size.
+     if ($img_assist_create_derivatives['custom_advanced'] && user_access('use original size')) {
+     
+       if ($properties_size['width'] <= $max_size[0] && $properties_size['height'] <= $max_size[1]) {
+         $derivatives[$properties_size['width']  .'x' . $properties_size['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');
***************
*** 854,860 ****
        '#type' => 'select',
        '#title' => t('Alignment'),
        '#default_value' => variable_get('img_assist_default_alignment', 'left'),
!       '#options' => array('left'=>'left', 'right'=>'right'),
        '#prefix' => '<span id="alignment">',
        '#suffix' => '</span>'
      );
--- 862,868 ----
        '#type' => 'select',
        '#title' => t('Alignment'),
        '#default_value' => variable_get('img_assist_default_alignment', 'left'),
!       '#options' => array('left'=>'left', 'right'=>'right', 'none'=>'none', 'center'=>'center'),
        '#prefix' => '<span id="alignment">',
        '#suffix' => '</span>'
      );
***************
*** 1262,1268 ****
    $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  = "<span class=\"inline {$attributes['align']}\">";
    $link = explode(',', $attributes['link']);
  
    if ($link[0] == 'node') {
--- 1270,1280 ----
    $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);
  
!   if ( $attributes['align'] == "center" ) {
!     $output = "<span class=\"inline {$attributes['align']}\" style=\"width: {$attributes['width']}px;\">";
!   } else {
!     $output  = "<span class=\"inline {$attributes['align']}\">";
!   }
    $link = explode(',', $attributes['link']);
  
    if ($link[0] == 'node') {
***************
*** 1648,1651 ****
  	return "<div class=\"%image-class\">\n  <a href=\"%node-link\"><img src=\"%src\" width=\"%width\" height=\"%height\" alt=\"%alt\" /></a>\n  <div class=\"caption\">%caption</div>\n</div>";
  }
  
! ?>
\ No newline at end of file
--- 1660,1663 ----
  	return "<div class=\"%image-class\">\n  <a href=\"%node-link\"><img src=\"%src\" width=\"%width\" height=\"%height\" alt=\"%alt\" /></a>\n  <div class=\"caption\">%caption</div>\n</div>";
  }
  
! ?>
