Tried the latest version as of today, but still doesn't work. No images displayed. It doesn't seem to be able to get to the image folder.

Comments

vacilando’s picture

Assigned: Unassigned » vacilando

Can you post a link to the non-working page, or a snipped from the table's HTML from the resulting page?

vph’s picture

Hi,
Here is the table. There are 3 pictures (Picture 125.jpg, Picture 126.jpg, Picture 127.jpg) in the folder. THe module seems to be able to get the correct path to the folder. But the first picture (Picture 125.jpg) was not picked up.

<table border="0" rules="none" frame="box" cellpadding="0" cellspacing="0" bordercolor="#000000" align="center" style="width:600px;"><tr>
<td align="center" bgcolor="#000000" style="padding: 3px 3px 3px 3px;vertical-align: middle;">
<a href="/sites/all/modules/brilliant_gallery/image.php?imgp=L2hvbWUvcGhhbjI1NDUvcHVibGljX2h0bWwvdGVzdC9maWxlcy9hbGJ1bXMvdGVzdC9QaWN0dXJlIDEyNS5qcGc=&imgw=1000&imgh=750" class="thickbox" rel="img_1567060">
<img style="display: block;border:0" src="/sites/all/modules/brilliant_gallery/image.php?imgp=L2hvbWUvcGhhbjI1NDUvcHVibGljX2h0bWwvdGVzdC9maWxlcy9hbGJ1bXMvdGVzdC9QaWN0dXJlIDEyNS5qcGc=&imgw=150&imgh=113" /></a></td>
<td align="center" bgcolor="#000000" style="padding: 3px 3px 3px 3px;vertical-align: middle;">
<a href="/files/albums/test/Picture 126.jpg" class="thickbox" rel="img_1567060"><img style="display: block;border:0" src="/sites/all/modules/brilliant_gallery/image.php?imgp=L2hvbWUvcGhhbjI1NDUvcHVibGljX2h0bWwvdGVzdC9maWxlcy9hbGJ1bXMvdGVzdC9QaWN0dXJlIDEyNi5qcGc=&imgw=150&imgh=112" /></a></td>
<td align="center" bgcolor="#000000" style="padding: 3px 3px 3px 3px;vertical-align: middle;">
<a href="/files/albums/test/Picture 127.jpg" class="thickbox" rel="img_1567060"><img style="display: block;border:0" src="/sites/all/modules/brilliant_gallery/image.php?imgp=L2hvbWUvcGhhbjI1NDUvcHVibGljX2h0bWwvdGVzdC9maWxlcy9hbGJ1bXMvdGVzdC9QaWN0dXJlIDEyNy5qcGc=&imgw=150&imgh=112" /></a></td></tr></table></p>
vph’s picture

Further, nothing gets displayed except a thin black bar, which i suppose is the empty black table.

vph’s picture

After a closer inspection of the generated HTML and a comparison to that of the demo site, I found some inconsistency.

The generated HTML for the first image (that I reported missing above) should have been something similar to this:

<a href="/files/albums/test/Picture 125.jpg" class="thickbox" rel="img_1567060">
<img style="display: block;border:0" src="/sites/all/modules/brilliant_gallery/image.php?imgp=L2hvbWUvcGhhbjI1NDUvcHVibGljX2h0bWwvdGVzdC9maWxlcy9hbGJ1bXMvdGVzdC9QaWN0dXJlIDEyNi5qcGc=&imgw=150&imgh=112" />

Instead it was this:

<a href="/sites/all/modules/brilliant_gallery/image.php?imgp=L2hvbWUvcGhhbjI1NDUvcHVibGljX2h0bWwvdGVzdC9maWxlcy9hbGJ1bXMvdGVzdC9QaWN0dXJlIDEyNS5qcGc=&imgw=1000&imgh=750" class="thickbox" rel="img_1567060">
<img style="display: block;border:0" src="/sites/all/modules/brilliant_gallery/image.php?imgp=L2hvbWUvcGhhbjI1NDUvcHVibGljX2h0bWwvdGVzdC9maWxlcy9hbGJ1bXMvdGVzdC9QaWN0dXJlIDEyNS5qcGc=&imgw=150&imgh=113" />

I dont know if this is the reason that the thumbnails were not displayed.

vacilando’s picture

I think I have a clue.

The parameter 'imgp' contains the path in case images have to be resampled to smaller size. Since your maximum size (not only thumbnail) image was resampled, it means it is wider than 1000px (an arbitrary threshold I set; larger images are useless for screen viewing).

Now, how wide (in pixels) are the images you have uploaded, and how large files are they, on average?

If they are coming directly from a modern digital camera, they are likely to be around 3000 pixels wide and up to 3 MB each. Ok, BG is designed to resample even so big images to 1000 px of width (and much smaller file size), but chances are that your PHP installation on your server will run out of memory while converting the images.

Anyway, that's what I think. To test this, make a copy of your photos, change their width to say 1200 px, and upload them to the gallery. The images will still be resampled, but the server will have much less work. If even that does not work for you, then it may be you have to upload even narrower images, like 800 px, but that should still be enough.

vph’s picture

That might be the culprit. After trying smaller pictures, there's another problem though. Fortunately, I figured out how to solve that problem and it seems to be working now.

The problem is that you should have used the Drupal function base_path() instead of "/". I installed Drupal in a subdirectory so the root "/" is incorrect. So I had to go in and changed "/" to base_path() in THREE places in render_brilliant_gallery.

I don't have a patch, but here are where you can find them:

$fullimgpath = base_path() . $path . '/' . $retval[$poct-1];

$result .= '<a href="' . base_path() . drupal_get_path('module', 'brilliant_gallery') .'/image.php?imgp=' . base64_encode( $absolpath . '/' . $retval[$poct-1] ) . '&imgw=' . $imgwbig . '&imgh=' . $imghbig . '"';

$result .= '<img style="display: block;border:0" src="' . base_path() . drupal_get_path('module', 'brilliant_gallery') .'/image.php?imgp=' . base64_encode( $absolpath . '/' . $retval[$poct-1] ) . '&imgw=' . $imgw . '&imgh=' . $imgh . '" />'; # width="' . $imgw . '"
vph’s picture

This might be related to this problem: http://drupal.org/node/175292

I don't understand how it worked for you there, using the "/". It's probably my server's configuration that doesn't work for "/". Nevertheless, I think using the Drupal's function base_path() is the proper way.

There are some glitches, but this is a nice module though. I like it because of the simplicity of uploading images to a directory instead of having to create nodes out of them first.

vacilando’s picture

Status: Active » Fixed

Thanks!

The thing is, I tested it in root and also on a subdomain. But it is true that just '/' would not work for a Drupal installation in a folder. You are correct that the base_path() is a better solution. I have already applied it in the meantime ( as an outcome of a different discussion - see http://drupal.org/node/176255 ), so if you want, get the current version (2.5) - that has it.

Remaining glitches? Could you please let me know which ones? Also, any suggestions for improvement are extremely welcome.

vph’s picture

Thanks. I didn't mean glitches as bugs. I meant the problem with images wider than 1000pixels. Yes, it's a good idea to always resize images to smaller than 1000pixels. But I'm not the only one who'll be using this feature, and when there are more people there are always those who don't follow the rules.

Maybe a solution is to notify users if some images are larger than 1000 pixels wide.

Anyway, thanks for your help.

vacilando’s picture

In answer to the 1000px rule concerns

1) There is a proper warning under 'known bugs' at http://drupal.org/project/brilliant_gallery

2) In version 2.6 the maximum image width is no longer set to 1000 px but configurable, so one can set it to anything. (In fact, if you set it to width greater than the widest image in your gallery, all images will show also in Thickbox, but if the images are huge, they will take forever to load.)

Anonymous’s picture

Status: Fixed » Closed (fixed)