When I click on the thumbnail to view an image using Lightbox2, I can see the file name of the original image, however, I see no link that will allow the user to download the original image. I thought I configured LightBox2 to allow that capability. Is this possible with this pair of modules (I'm using the 'recommended' release for 6x of both modules)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drpchris’s picture

You have to change the code of BG. Try this:

brilliant_gallery.module:
line 448 original:
$displayimage .= ' rel="lightbox['. $setname .']"';

new:
$displayimage .= ' rel="lightbox[' . $setname . '][<a href="' . $fullimgpath . '">' . $caption . '</a>]"';

Should give you a link to the image with the caption as the text.

drpchris’s picture

Assigned: Unassigned » drpchris
Status: Active » Needs review
icesurfer’s picture

Assigned: drpchris » Unassigned
Status: Needs review » Active

Thanks. I'm new to drupal so I'm wary of hacking the modules at this time.

I found a way to get the high resolution image without modifying the module (although it requires the user to do a right-click). I set the maximum image width to 5000. When the thumbnail is clicked, I get a medium resolution image, if I expand that using the 4-outward-pointing-arrows icon the high resolution image is shown in a new window. The user can then right click and save the image. This should work for my tech-savy users until I have the courage to hack the module code.

(Nice to get such fast response to a question!)

icesurfer’s picture

I made the change but there is still no link in the lightbox. I cleared the cache... do I need to do something else to see the change occur?

drpchris’s picture

SOrry didn't notice some other things:

you need to insert this at line 745 (before the switch ($overbrowser) { line):

if ($showcaption <> '' && $showcaption <> 'filename') {
     $caption = $showcaption;
}
icesurfer’s picture

Title: Is Brillian Image - Lightbox2 capable of allowing user to download original image » Is Brilliant Gallery - Lightbox2 capable of allowing user to download original image

I have made both changes on both my public and test website. I still don't have an option to download the original image. Could I be missing a security setting? (I have tested as user 0 as well as authenticated and anonymous users with the same results)

drpchris’s picture

Is there a URL you can give out so we can look at what you've got?

icesurfer’s picture

Sorry for the slow reply, other projects have taken priority this month. Now I'm back to working on my drupal site again. Please see Brilliant Image in use here: http://www.dasselambassadors.com/node/7

(I have the 6.x-3.6 release running on my localhost testbed, and I don't get a link to the original photo using the 3.6 release either)

drpchris’s picture

No link because it's not showing up in your code. Maybe attach your brilliant_gallery.module file here so we can take a look?

icesurfer’s picture

FileSize
50.42 KB

I have attached my current brilliant_gallery.module. It is the same as the 6.x-3.6 module (square thumbnails) with the exception of line 448. I had to add a .txt extension so I could upload it to this site.

drpchris’s picture

Sorry - I gave the wrong line numbers the first time. I've attached a corrected file. The difference is that the change needs to be in the render_brilliant_gallery() function (approx line 860), not in the render_brilliant_gallery_manage() function.

drpchris’s picture

Assigned: Unassigned » drpchris
icesurfer’s picture

Status: Active » Reviewed & tested by the community

It works! Thanks.

Will this be included in new releases, or will I need to make the patch with each new release?

In the past 4 days I installed Eclipse-PDT with the Zend debugger so I could single step through the code. Before I started stepping through the code, I thought I'd check the forum once more for an update. I was very pleased to see the solution posted.

skobe’s picture

hey drupals,

3 years later i'm facing the same problem.. I'm using D7.15 lightbox2 7.x-1.0-beta1 and brilliant gallery 7.x-1.2 and tried your solution but as i expected it doesn't work with the new versions of this set of modules.

has anyone managed to provide a link in the lightbox to download the original image coming from a brilliant gallery?

appreciate any suggestions or thougts on this! thanks in advance!
skobe

SmokinX’s picture

Issue summary: View changes

@skobe

again 2 years later, I'm facing this too.

I applied above tip to lines 511 - 515 of gallery_showtime.inc in the D7 version with Lightbox2 selected:

case 'lightbox':
$result .= ' rel="lightbox[' . $setname . <strong>'][&lt;a href=&quot;' . 
$fullimgpath . '&quot;&gt;' . $caption . '&lt;/a&gt;]"';</strong>
#$attributes['rel'] = 'lightbox[' . ($node->nid? $node->nid: time()) . ']'; // 'insert' has no $node->nid
break;

Image caption is now opening the original image! Will do some more tweaking so it downloads instead of opens in window.

SmokinX’s picture

Adjusted the code to download the image:

case 'lightbox':
$result .= ' rel="lightbox[' . $setname . '][&lt;a href=&quot;' . 
$fullimgpath . '&quot; download=&quot;&quot;&gt;' . $caption . '&lt;/a&gt;]"';
#$attributes['rel'] = 'lightbox[' . ($node->nid? $node->nid: time()) . ']'; // 'insert' has no $node->nid
break;