Index: thickbox/thickbox.module =================================================================== --- thickbox/thickbox.module (revision 1107) +++ thickbox/thickbox.module (working copy) @@ -128,6 +128,7 @@ } if (variable_get('thickbox_auto', 0) && module_exists('image')) { + drupal_add_js("var base_path = ". drupal_to_js(base_path()) .";", 'inline'); drupal_add_js("var thickbox_derivative = ". drupal_to_js(variable_get('thickbox_derivative', 'preview')) .";", 'inline'); drupal_add_js($path .'/thickbox_auto.js'); } Index: thickbox/thickbox_auto.js =================================================================== --- thickbox/thickbox_auto.js (revision 1107) +++ thickbox/thickbox_auto.js (working copy) @@ -38,11 +38,11 @@ * the script should allways use the original picture ("true || "). */ if (thickbox_derivative == "original") { - var href = img.attr("src").replace(".thumbnail", ""); + thickbox_derivative = "_original"; } - else { - var href = img.attr("src").replace(".thumbnail", "." + thickbox_derivative); - } + + var original_href = $(this).attr("href").replace(new RegExp('^' + base_path + '(node/)?'), ""); + var href = base_path + "image/view/" + encodeURIComponent(original_href) + "/" + thickbox_derivative + "/image.jpg"; // Finally rewrite the link and wait for thickbox.js to apply the effects. $(this).attr({href: href, title: title, rel: group}); Index: image/image.module =================================================================== --- image/image.module (revision 1105) +++ image/image.module (working copy) @@ -804,6 +804,16 @@ } if (isset($nid)) { + if (!is_numeric($nid)) { + $path = drupal_get_normal_path(urldecode($nid)); + if (strpos($path, 'node/') === 0) { + $nid = substr($path, 5); + } + else { + return drupal_not_found(); + } + } + $node = node_load(array('type' => 'image', 'nid' => $nid)); if ($node) { if (!node_access('view', $node)) {