Thanks so much for adding this functionality, snpower. An issue I'm having, is that after specifying for Lightbox to be triggered for images of the class "image-img_assist_custom," when the image is one that is too small for a 'preview' size image to have been generated, the Lightbox shows the image's custom size (the one embedded in the page), rather than the largest available, which is the original.

Lightbox quite correctly shows the original image when there isn't a larger 'preview' size one available (this is awesome!), but it seems that for images that were custom sized in TinyMCE via Image Assist, this doesn't work.

Can this be fixed?

Thanks!

CommentFileSizeAuthor
#11 lightbox2_222273.patch1.64 KBstella

Comments

stella’s picture

Can you show me the page source or give me a url? I have tinyMCE and image assist installed but I can't get the two to work together. I'm not that familiar with TinyMCE, could you perhaps provide more details on how you add the image to the page and the settings you use.

Cheers,
Stella

akahn’s picture

Hey Stella. Yes, getting TinyMCE and Image Assist working together can be a bit tricky, mostly because of poor documentation, I think. You need to install the module for Drupal, and also install a TinyMCE plugin called 'drupalimage' that it comes with the module.

Here's the HTML for the image that loads the custom size (the size that's already being displayed on the page) rather than its original size.

<span class="inline inline-left"><a href="/drupal/en/files/images/youth.jpg" onclick="launch_popup(30, 480, 640); return false;" target="_blank"><img src="/drupal/files/images/youth.img_assist_custom.jpg" alt="" title="" class="image image-img_assist_custom" width="194" height="259" /></a></span>

In Image Assist, the image is set to pop-up in a new window (same setting as for images set to the 'thumbnail' size, which work fine), and then once the image is embedded in TinyMCE, I dragged its corner handle to make it a custom size (this can also be done in in the Image Assist popup.

Let me know if you need any additional info. Thanks for helping with this!

-Alex

stella’s picture

Status: Active » Fixed

This should now work in the latest dev release, which will be available later today.

Cheers,
Stella

akahn’s picture

Thanks a lot. You're helping my site come along!

akahn’s picture

Hey Stella, I've given the new dev release a try, and now when I click on a thumbnail that has been custom-sized, Lightbox brings up its 'image not found' image.

Below is the HTML code on the page. The file the <a> links to actually does not exist, because the file is in /drupal/files/images/youth.jpg not /drupal/en/files/images/youth.jpg. (I think the i18n module, and maybe pathauto, is putting in the "en." Is that right, do you think?)

<span class="inline inline-left"><a href="/drupal/en/files/images/youth.jpg" onclick="launch_popup(30, 480, 640); return false;" target="_blank"><img src="/drupal/files/images/youth.img_assist_custom.jpg" alt="" title="" class="image image-img_assist_custom" width="192" height="256" /></a></span>

However, another image embedded in this node (set to display in thumbnail size, not custom) that also links to a file that doesn't exist in its <a> tag, but the image still displays its larger version in Lightbox correctly. I guess the Lightbox script uses some other data to determine what image it opens.

<span class="inline inline-right"><a href="/drupal/en/files/images/DSCF0500.preview.JPG" onclick="launch_popup(29, 544, 408); return false;" target="_blank"><img src="/drupal/files/images/DSCF0500.thumbnail.JPG" alt="" title="" class="image image-thumbnail" width="100" height="75" /></a></span>

Anyways, do you have any idea why this is happening? Can it be fixed?

Many thanks,
Alex

stella’s picture

Lightbox2 (latest version) should handle the "/en" bit of the path if it appears at the beginning of the path, e.g. <a href="/en/files/images/DSCF0500.preview.JPG" ..... What's your file system path set to (admin/settings/file-system)?

The second scenario works because it's an image node, and for image nodes it uses the img src path to determine the image.

Cheers,
Stella

akahn’s picture

Glad to hear the "en" part is no problem. My filesystem path is files.

Note: both of these images are image nodes, just one is set to a preset size and one is set to a custom size.

Let me know if you need any other info.

Thanks,
Alex

stella’s picture

Hmmm but you have /drupal before the /en/files/..... Where is that coming from do you know?

akahn’s picture

Yeah, my Drupal installation is in a directory called drupal, so my Drupal site's root is at http://localhost:8888/drupal/.

akahn’s picture

Status: Fixed » Active

Hi again. Any word on this issue? Is it fixable? Is it reproduce-able? Do you need more info from me?
Thanks much,
Alex

stella’s picture

Status: Active » Needs review
StatusFileSize
new1.64 KB

Try the attached patch.

akahn’s picture

This patch does the trick. Thanks again. :)

stella’s picture

Status: Needs review » Fixed

Fixed in 5.x and 6.x versions (will be available in next dev release).

Cheers,
Stella

stella’s picture

Released in lightbox 2 5.x-2.5 and lightbox 2 6.x-1.5.

Cheers,
Stella

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.