--- image_attach.module	Thu May 10 12:46:48 2007
+++ image_attach.modified.module	Thu May 10 12:44:48 2007
@@ -80,6 +80,18 @@
       '#default_value' => variable_get('image_attach_weight_body_'. $form['#node_type']->type, 0),
       '#description' => t("This value determines the image's weight in the body."),
     );
+	$form['workflow']['image_attach_size_teaser'] = array(
+	  '#type' => 'textfield',
+	  '#title' => t('Size for attached images (teaser)'),
+	  '#default_value' => variable_get('image_attach_size_teaser_'. $form['#node_type']->type, 'thumbnail'),
+	  '#description' => t('name of image size. Use &lt;none&gt; to hide image')
+	);  
+	$form['workflow']['image_attach_size_body'] = array(
+	  '#type' => 'textfield',
+	  '#title' => t('Size for attached images (body)'),
+	  '#default_value' => variable_get('image_attach_size_body_'. $form['#node_type']->type, 'thumbnail'),
+	  '#description' => t('name of image size. Use &lt;none&gt; to hide image')
+	);  
   }
   // Node edit form.
   else if (isset($form['type']) && $form['type']['#value'] != 'image') {
@@ -323,14 +335,17 @@
  * If you have additional image sizes you defined in image.module, you can use them by theming this function as well.
  */
 function theme_image_attach_teaser($node){
-  drupal_add_css(drupal_get_path('module', 'image_attach') .'/image_attach.css');
-
-  $image = node_load($node->iid);
-  $info = image_get_info(file_create_path($image->images['thumbnail']));
-
-  $output = '<div style="width: '. $info['width'] .'px" class="image-attach-teaser">';
-  $output .= l(image_display($image, 'thumbnail'), "node/$node->nid", array(), NULL, NULL, FALSE, TRUE);
-  $output .= '</div>'."\n";
+  $img_size = variable_get('image_attach_size_teaser_'. $node->type, 'thumbnail');
+  if ($img_size != '&lt;none&gt;') {
+	  drupal_add_css(drupal_get_path('module', 'image_attach') .'/image_attach.css');
+
+	  $image = node_load($node->iid);
+	  $info = image_get_info(file_create_path($image->images[$img_size]));
+
+	  $output = '<div style="width: '. $info['width'] .'px" class="image-attach-teaser">';
+	  $output .= l(image_display($image, $img_size), "node/$node->nid", array(), NULL, NULL, FALSE, TRUE);
+	  $output .= '</div>'."\n";
+  }
   return $output;
 }
 
@@ -338,14 +353,17 @@
  * Theme the body
  */
 function theme_image_attach_body($node){
-  drupal_add_css(drupal_get_path('module', 'image_attach') .'/image_attach.css');
-
-  $image = node_load($node->iid);
-  $info = image_get_info(file_create_path($image->images['thumbnail']));
-
-  $output = '<div style="width: '. $info['width'] .'px" class="image-attach-body">';
-  $output .= l(image_display($image, 'thumbnail'), "node/$node->iid", array(), NULL, NULL, FALSE, TRUE);
-  $output .= '</div>'."\n";
+  $img_size = variable_get('image_attach_size_body_'. $node->type, 'thumbnail');
+  if ($img_size != '&lt;none&gt;') {
+	  drupal_add_css(drupal_get_path('module', 'image_attach') .'/image_attach.css');
+
+	  $image = node_load($node->iid);
+	  $info = image_get_info(file_create_path($image->images[$img_size]));
+
+	  $output = '<div style="width: '. $info['width'] .'px" class="image-attach-body">';
+	  $output .= image_display($image, $img_size);
+	  $output .= '</div>'."\n";
+  }
   return $output;
 }
 
