I upload fullsize (about 4MB) photos to my site. I have Thickbox installed and have told it to display smaller versions of the photos. When I access a photo using thickbox, Drupal takes a long time to send the photo to the web browser, and I think it is sending the full size image. When Thickbox displays it, it is displayed correctly as a smaller image.

This obviously makes things a little slow!

You can see this in my test site http://test.clyne.org which is a new install of Drupal 5.1. Select Galleries from the menu and then drill down three layers to a small galelry with 2 pictures.

Richard

Comments

gribnif’s picture

Thickbox automatically scales the image down so it fits within the confines of the browser window. So the 4 Mb image is being downloaded, and then scaled smaller. That's why it takes a long time but doesn't look huge.

smok-1’s picture

I understand that, but I would have thought that as Thickbox has an option for 'Image Derivative' it should be using that option to control what image it requests.

frjo’s picture

I unfortunately don't use the image module myself and the script that integrates Thickbox with it is contributed from a user.

Hopefully someone else using Thickbox with the image module will contribute a patch.

kleingeist’s picture

Status: Active » Closed (duplicate)

Hi Smok,
there is currently a bug in the derivative selection, which breaks the thickbox functionality if the uploaded image is actually smaller, than the selected derivative dimensions (see: http://drupal.org/node/125610).
As long as there is no patch, the derivative function is disabled in thickbox_auto.js. If you want to reenable it, you have just to edit two little things in this file

from:

    if (true || thickbox_derivative == "original") {
      var href = img.attr("src").replace(".thumbnail", "");
    }

to:

    if (thickbox_derivative == "original") {
      var href = img.attr("src").replace(".thumbnail", "");
    }

and two lines below *blush*:

 var href = img.attr("src").replace(".thumbnail", "." + thickbox_derivate);

to:

 var href = img.attr("src").replace(".thumbnail", "." + thickbox_derivative);

I hope this will help you.

frjo’s picture

Could we not commit this change and instruct users that encounter the derivative selection bug to set thickbox_derivative to "original"?