? thickbox-derivative-1.patch
Index: thickbox.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/thickbox/thickbox.module,v
retrieving revision 1.8
diff -u -r1.8 thickbox.module
--- thickbox.module	26 Dec 2006 20:02:03 -0000	1.8
+++ thickbox.module	13 Feb 2007 10:54:48 -0000
@@ -23,6 +23,21 @@
     '#description' => t('Automaticly activate Thickbox for all image nodes.'),
   );
 
+  if (module_exists('image')) { 
+    $options = array('original' => t('original'));
+    $sizes = _image_get_sizes();
+    foreach ($sizes as $size) {
+      $options[$size['label']] = $size['label'];
+    }
+    $form['thickbox_options']['thickbox_derivative'] = array(
+      '#type' => 'select',
+      '#title' => t('Image derivative'),
+      '#options' => $options,
+      '#default_value' => variable_get('thickbox_derivative', 'preview'),
+      '#description' => t('Select which image derivative will be loaded.'),
+    );
+  }
+
   return system_settings_form($form);
 }
 
@@ -48,6 +63,7 @@
       drupal_add_css($path .'/thickbox.css');
       drupal_add_js($path . '/thickbox.js');
       if (variable_get('thickbox_auto', 0) && module_exists('image')) {
+        drupal_add_js("var thickbox_derivative = " . drupal_to_js(variable_get('thickbox_derivative', 'preview')) . ";", 'inline');
         drupal_add_js($path . '/thickbox_auto.js');
       }
     }
Index: thickbox_auto.js
===================================================================
RCS file: /cvs/drupal/contributions/modules/thickbox/thickbox_auto.js,v
retrieving revision 1.1
diff -u -r1.1 thickbox_auto.js
--- thickbox_auto.js	9 Oct 2006 07:14:48 -0000	1.1
+++ thickbox_auto.js	13 Feb 2007 10:54:48 -0000
@@ -11,11 +11,16 @@
 
 function TB_drupal_init() {
   var i = $(this).children("img");
-  var t = i.title() || i.attr("alt") || null;
-  var u = i.src().replace(".thumbnail","");
+  var t = i.title() || i.attr("alt") || null;
+  if (thickbox_derivative == "original") {
+    var u = i.src().replace(".thumbnail", "");
+  }
+  else {
+    var u = i.src().replace(".thumbnail", "." + thickbox_derivative);
+  }
   var g = null; //not yet supported, would require the rewrite
 
   TB_show(t,u,g);
   this.blur();
   return false;
-}
\ No newline at end of file
+}
