Since i updated Brillant gallery to 2.1, i loses all the thumbs in the nodes!

I have clearead the cache into drupal and my browser too.... I don't understand

Members fund testing for the Drupal project. Drupal Association Learn more


manuscle’s picture

I can see the source code and i think the value in the link for the image is not correct

doener321’s picture

the same on my website after updating to 6.x-2.2 (Drupal 6.8, Linux, Mysql 5.0.51a, PHP 5.2.6, PHP-Memory 65MB)

Thumbs not working. if i execute the src-Attribute of the img-Tag i get the following:

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1231795097 SET data = 'cache', created = 1231535897, expire = 0, headers = '', s' at line 1 query: UPDATE 1231795097 SET data = 'cache', created = 1231535897, expire = 0, headers = '', serialized = 0 WHERE cid = 'bg_c50e5487db1c0b0239dca945cd0ac4f6' in /www/htdocs/xxx/includes/ on line 128

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxx/includes/ in /www/htdocs/xxx/sites/all/modules/brilliant_gallery/image.php on line 42

followed by jpg binary

I get the JPEG binary, but the mysql error message breaks it. (Maybe a problem with brilliant gallery cache table, UPDATE statement tries to write into a table named 1231795097 (this value gets higher on each request).

francula’s picture

Version: 6.x-2.1 » 6.x-2.2

me too

superflyman’s picture

Same issue, all thumbs show up as black boxes with ? marks, sites looks a mess... If I hover over, I get the right image name (alt tag) but no image loads from lightbox either.

drpchris’s picture

I posted the same problem is the image.php error output in:

AlexisWilke’s picture

I have the fix guys.

I'm not too sure why we got a version 2.2 that does not work at all... 8-)

The cache_set() in image.php needs to be used as follow:

  cache_set($bgcacheid, $my_data, 'cache', time() + $bgcachexpire);

Version 2.2 has the $my_data at the end instead.

The cache handling between 5.x and 6.x has changed in that regard.

Thank you.
Alexis Wilke

Johnl’s picture

Thanks, I was having this problem too and that code fixed it for me.

foxmarks’s picture

I see no thumbs, and no alt image info either. The [bg] tag seems to work partially, as I can adjust the number, size and color of the placeholder boxes which appear where pics should be.

My galleries are recognized in administer>*>brilliant gallery>manage galleries

I’m at my knowledge frontier, but it seems like maybe BG and Lightbox2 aren’t getting along?

AlexisWilke’s picture


The author has not applied the fix yet. He's either being very lazy or very busy. I'd bet very busy. 8-)

You have to edit the module file and fix the cache_set() function call as defined in #6. With WordPad or some other text only editor.

Thank you.

naveenindia’s picture

Thanks Alexis,

I was installing the module and getting nothing for the last 2 days until i found this thread and your answer.

Finally i'm getting what i wanted...!

foxmarks’s picture

I was looking for the code to change in the .module file. Wrong spot…

I found the function you pointed to on line 105 of the image.php file, made the change, and everything works again. :-)

Thank you, Alexis!

AlexisWilke’s picture

Version: 6.x-3.0 » 6.x-2.2
Status: Reviewed & tested by the community » Active


I'm glad you found the right spot 8-) Sorry my message was indeed somewhat misleading, I'm fixing the original one now.


ericwongcm’s picture

5.87 KB

The latest 6.x-3.0 Brilliant Gallery have the same bug as described in 6.x-2.2

Attached is the modified file, changed according to the instruction by #6 above.
The attached file here is for 5.x-4.4.
(should have mentioned when I post this last time :p.....that's probably why it didn't work for you using Drupal 6)

See #66 for Drupal 6, 6.x-3.0 fix.

Well, this fix work for me. Hope it helps you ;)
(can't believe none of you tried to contact me when this patch didn't work when you can contact me via my URL....)

ericwongcm’s picture

Version: 6.x-2.2 » 6.x-3.0
Status: Active » Reviewed & tested by the community

well, the file should be renamed to image.php
Don't know why it becomes image.php_.txt after I attach and uploaded it.

AlexisWilke’s picture,

The .php files (and some others) are auto-renamed by Drupal so you do not take the risk to have them executed by Apache. I think that could be done under the hood and not on screen, but that's the way it is at this time with Drupal.

So in other words: That's a feature!

Alexis Wilke

graymom’s picture

Thank you Alexis,

After many frustrations, my thumbnails and images are finally visible.

Thanks again,

caf’s picture

This patch doesn't work on my Installation.
Drupal 6.9 with 6.x-3.0 and colorpicker
Images are downloaded to /tmp but no thumbs visible.
Lightbox is working.

AlexisWilke’s picture

Version: 6.x-2.2 » 6.x-3.0
Status: Active » Reviewed & tested by the community

I did not yet try with 3.0... maybe tomorrow or the next day. I thought someone said it worked for them with 3.0 though. Yeah! You may want to look at #13.

Thank you.
Alexis Wilke

TallDavid’s picture

The updated code, as described in posts 6 and 11, corrected the problem for me on Drupal 6.9 with Brilliant_Gallery version = "6.x-3.0".

Thanks for the pointer!

mike69’s picture

Thanks for posting #6. That works for me perfect!


AlexisWilke’s picture


I updated on my end. I also have another set of fixes for PostgreSQL. Are you using PostgreSQL by any chance? If so, then no wonder. The author has MySQL and broke the use of PostgreSQL in a couple of places. (i.e. the database uses 'user' as a field which is a reserved keyword in PostgreSQL and he has one statement with state='1' but state is an integer and needs state=1 instead.)

I will post a patch in that bug. It's here: #357376: Totally broken with PostgreSQL.

Thank you.
Alexis Wilke

AlexisWilke’s picture

There is an actual patch for those who prefer that instead of direct editing of the code.

manuscle’s picture

Thanks a lot!

It's now working on my website!
So, after patching, don't forget to clear the cache ;-)

longjefferson’s picture

Thank you AlexisWilke.

It worked for me.

I hope the next person to download BG has your code added in to it.

Rom4n’s picture


I have tried to edit image.php file as described above but with no result. I dont see any thumbnails at all. As I am not very familiar with PHP or web coding, could anyone check my site and try to help me if possible, please?

Thanks very much :-)

AlexisWilke’s picture


Did you try to reset your cache as mentioned by #23?

Thank you.

Rom4n’s picture

Yes I did, but it is still the same.

caf’s picture

sorry, i forgot to mention mysql in my post.

same thing as on #27.

i am also testing with both caching possibiltys - neiter of them is working.

is there any logging possible? Other Sites do the trick - so it must be a problem with the module interaction.

(I got such things mit xml-sitmap and pathauto)

Thank you very much for your module and help.

AlexisWilke’s picture

I'm using xmlsitemap, so that's not it, at least not this time. 8-)

I'm not aware of much logging from this module, but you could check to make sure you do not see errors from when you check that page with a gallery.

There could be permissions issue too (like the files cannot be read, but if LightBox2 works, not the case...). Make sure you can see images by typing their full path by hand (ie.

Otherwise, this is not my module, so don't thank me for this mess! I created a few things like the CuteMenu, PAD File and Addresses Extra though. 8-) (click on my name and scroll at the bottom to see the list)

I suppose that the tag itself ([bg|...]) is not shown on your page. You do see white instead of the images, right? Otherwise, the filter would not be active...

There could be a path issue. Did you look at the HTML generated? It should include the <img ...> tags with the path to the image file. Verify that this is correct.

Do you have a multi-site install? If so, could you test the module on another site to see whether it works on there? That way, you could compare what modules are ON and OFF on both sites and try to determine whether another module interacts "weirdly".

Well... I'm running out of ideas otherwise...

Okay, two more things still:

If you have an HTTP server with added security, you may want to make sure that these security features do not prevent the images from being generated. I had that problem with modsecurity2.

Also, I had problems in the image generator because of modsecurity2, rom4n has problems too. Apparently because some image library is not installed (G2 or something like that?)

Look at the HTML code, and get the URL in the src attribute of the <img src="..."/> tag. Then copy that in your browser URL line. If you see something as follow, you'll probably know what to do. 8-)

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /storage/www/ on line 147

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /storage/www/ on line 148

Warning: imageinterlace(): supplied argument is not a valid Image resource in /storage/www/ on line 150

Warning: imagecolortransparent(): supplied argument is not a valid Image resource in /storage/www/ on line 151

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1233302260 SET data = 'cache', created = 1233043060, expire = 0, headers = '', s' at line 1 query: UPDATE 1233302260 SET data = 'cache', created = 1233043060, expire = 0, headers = '', serialized = 0 WHERE cid = 'bg_0fbbb0c738bb3f0b3e27e6cff6b309d4' in /storage/www/ on line 128

Warning: Cannot modify header information - headers already sent by (output started at /storage/www/ in /storage/www/ on line 42

Warning: imagejpeg(): supplied argument is not a valid Image resource in /storage/www/ on line 157
yhager’s picture

Patch in #22 worked for me. Thanks.

caf’s picture

Now i see that it is a permission issue.
Another Installation on the same server works -- i love this module!

But the problem is still there:
I have checked the directory permissions on both installations from the top level.

to /home/www/sites/sitename/files
both with same permissons.

.htaccess is also the same

drupal permission are also set in the same way (checked 4 times)

AlexisWilke’s picture


I have no idea beyond that. Maybe you should ask the actually owner of the module 8-)

Good luck,
Alexis Wilke

Rom4n’s picture

Uhm, I still dont know what to do :))

Look at the HTML code, and get the URL in the src attribute of the Only local images are allowed. tag. Then copy that in your browser URL line. If you see something as follow, you'll probably know what to do. 8-)

As I said before, I dont understand PHP at all and html+css only a little bit. But it seems to me that if you copied sth from my site here, you could know where is the problem :) Please, could you describe me how to fix the problem in a kind of simple way? I would be very greatful.

Thanks, Roman

AlexisWilke’s picture


Sorry! I actually tried again and I noticed I did not change the &amp; into a simple '&' character in the URL. So the error is actually with MySQL as follow:

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1233736679 SET data = 'cache', created = 1233477479, expire = 0, headers = '', s' at line 1 query: UPDATE 1233736679 SET data = 'cache', created = 1233477479, expire = 0, headers = '', serialized = 0 WHERE cid = 'bg_77f998d82fb3228fc853651e11880be9' in /storage/www/ on line 128

The name of the table is totally wrong (the number after the UPDATE keyword).

This may come from resizeimage_wrapper_filecache() or resizeimage_wrapper_dbcache(). Since you get a DB error, you certainly have a problem with the 2nd function. And that would be the call to the cache_set() function using the wrong parameters. Did you really apply the fix in the image.php on the site itself?

Thank you.

Rom4n’s picture

LOL :) My problem was that I have Drupal 6, but in the image.php file it used to be set up as for Drupal 5. Now it is working perfectly. Thank you for the effort :)

AlexisWilke’s picture


Well?! This is what the patch in #22 and #6 are about?! Did you not even apply those???


geerlingguy’s picture

Patch in #22 worked great for me! Please commit it to the module - thanks!

sphoenixee’s picture

patch #22 works great for me as well.

before no images show up, now it's good. thanks!!

tahirrehan’s picture

I have tried every possible solution i found online. i tried #6 and still no pictures. i tried to debug using the procedure in #29. interestingly src file doesn't show any pcture. i copy pasted the link for a picture from html page and it took me to a strange page.

this is the link to one of the picture:

i can see the albums in brilliant gallery "manage galleries". but whenever i post any of the album in any page, it simply wont work.

here is the website:

brilliant gallery is visible to all the users.

any help will be appreciated
thanks in advance

AlexisWilke’s picture


At this time you have a <code> tag in your [bg...] tag and it fails completely. If you are using a WYSIWYG editor, then you should edit the source to make sure that the tag is clean. It could also be that your http://... is transformed by another filter before the Brilliant filter is applied. Look at your Input filters and change the order.

Thank you.

tahirrehan’s picture

Thanks a lot for the reply.

i am not using WYSIWYG editor. i don't even what that is since i am not a web designer. this is just a site that i am making for my student association.
for the filter thing. i made a new filter that only allows brilliant tags and nothing else. i combined it with HTML filter and other stuff but still no luck. the only reason now i can think of is that may be it is not allowed by my host. i had the same problem with updating my website and i would get the same error. since my university is hosting this website, i think they are bit tight about kindda stuff u can do on the website. i will talk to the IT support and will let you know if it works out.

but please do let me know if you can think of any other solution.

one more thing, brilliant gallery doesnt work with picasa at all. do you have any idea why would it do that.

thanks again


creamneuron’s picture

thanks alot! puting the ", $my_data" from the end before "'cache'" worked fine for me. Now the thumbs are shown.
this got me a lot of headache, glad that i found this.

emdeex’s picture

I'm still getting the black boxes instead of the thumbnails.

I've made the changes suggested to image.php.

I've cleared the drupal cache, I'm on drupal 6.10 with BG 6.x-3.0. Ive tried using drupal's cache and the files-cache method.

I set the Brilliant Gallery cache to be "Use the temporary directory you have set in /admin/settings/file-system. Faster than database caching!"

My drupal files tempory setting is at "files/tmp" and the permissions are 777

My images are under "files/albums" and the directory is 755, I can view the files via a browser if I type in the image URL directly.

emdeex’s picture

OK, my bad, does seem to be working now. I had typed some garbage text into the images.php when making the changes, cleared that out, and its working again.

mchopra’s picture

I have been trying very hard to get BG working on my website, but no luck so far!
I have BG 6.x-3.0 and Drupal 6.9 I have applied the above patch to image.php

 cache_set($bgcacheid, $my_data, 'cache', time() + $bgcachexpire);

I have cleared cache
I think my folders have correct permissions

Check this image

I have this image visible in Manage Galleries
On the BG block I just see Black Boxes

and If I click on them
they are directed to this weird page

I have GD enabled for my php.

I am lost, I really like this module and would love to use it but I am stuck for last fifteen days just trying to make it work.
Can anybody please help.

grosseout’s picture

I'm in the same boat...
I replaced my image.php file with the one in #13, and that didn't work.
Still the same problem, If I delete the index.php in my url, the image shows up, but in the bg i just get a grid of question mark boxes like you.
Is the patch that alexis posted in #22 different? and if so, how do I install it...
I feel completely incompetent. All this time, no results...
please help...
this is my URL just incase someone has time

mchopra’s picture

The patch posted is the same

AlexisWilke’s picture


Looks like there would be a conflict between GoDaddy free hosting and Drupal...

As I mentioned earlier, you need to test YOURSELF that you can get the images.

This is done with tools such as wget and the URL defined in your <img ... > tag. More specifically, the URL found inside the src="..." attribute.

The following is the Brilliant Gallery code as it appears for your home page (btw, the JPG could not be found)

 <div class="defaultblock">
    <h2>Brilliant gallery</h2><!--block title-->

   <div class="blockcontent"><ul style="font-size:0; margin:0px; padding:0px; width: 780px;"><li style="font-size:0; float: left; width: 150px; list-style: none; background: #000000; height: 113px; padding: 3px; text-align: center; margin: 0px; border: none;">
<a href=""><img style="border: 0; margin:0px; padding:0px;" alt="" src="" /></a>
<li style="font-size:0; float: left; width: 150px; list-style: none; background: #000000; height: 113px; padding: 3px; text-align: center; margin: 0px; border: none;">
<a href=""><img style="border: 0; margin:0px; padding:0px;" alt="" src="" /></a>

When I use wget to retrieve one of the images, I get the following file (obviously NOT an image):

00000000-  0A FF D8 FF E0 3C 2F 69 66 72 61 6D 65 3E 3C 2F .ÿØÿà</iframe></
00000010-  6E 6F 73 63 72 69 70 74 3E 3C 2F 6F 62 6A 65 63 noscript></objec
00000020-  74 3E 3C 2F 6C 61 79 65 72 3E 3C 2F 73 70 61 6E t></layer></span
00000030-  3E 3C 2F 64 69 76 3E 3C 2F 74 61 62 6C 65 3E 3C ></div></table><
00000040-  2F 62 6F 64 79 3E 3C 2F 68 74 6D 6C 3E 3C 21 2D /body></html><!-
00000050-  2D 20 61 64 73 6F 6B 20 2D 2D 3E 0D 0A 3C 73 63 - adsok -->..<sc
00000060-  72 69 70 74 20 6C 61 6E 67 75 61 67 65 3D 27 6A ript language='j
00000070-  61 76 61 73 63 72 69 70 74 27 20 73 72 63 3D 27 avascript' src='
00000080-  68 74 74 70 73 3A 2F 2F 61 31 32 2E 61 6C 70 68 https://a12.alph
00000090-  61 67 6F 64 61 64 64 79 2E 63 6F 6D 2F 68 6F 73
000000A0-  74 69 6E 67 5F 61 64 73 2F 67 64 30 31 2E 6A 73 ting_ads/gd01.js
000000B0-  27 3E 3C 2F 73 63 72 69 70 74 3E 0D 0A          '></script>..

You have to find out why that happens and it could be that GoDaddy prevents you from doing anything.


For you the src URL gives me a 404. So you probably did not point the path to the correct place.

Thank you
Alexis Wilke

mchopra’s picture

Alexis Wilke,
Thanks a lot I very much appreciate your help and I will try to figure out the issue with goDaddy.


mchopra’s picture


I had JPG instead of jpg so that is why this link was not working.

As you have pointed in the Only local images are allowed. tag the URL is

Then I did a base64_decode on the string

and got a path /home/content/m/c/h/mchopra/html/sites/default/files/images/IMG_0069.jpg

And if I try to wget
I got an image!

So I don't know where is the problem with Godaddy?

Thanks for all your help.

drpchris’s picture

FYI: I gave up on godaddy a couple years ago and went with (there are many others also) because godaddy didn't (at the time) allow web apps to make outbound connections (to open a socket out from the webserver app). This was before I started using drupal.

grosseout’s picture

At the image 404 source page,
, if you delete the index.php, right after the home url, so that the code is this,

the image shows up. When I look at the source code for my main gallery page,

it appears to be the same problem for my gallery images, so does this mean that I still have a screwed up path or is there some other reason that that index.php is being added? Also, these images are being fetched from picasa. I get the same problem though when the images are on the server. In another post I asked if it could be a problem with my host,, but the response was no. I also tried reinstalling the brilliant gallery database, no change.
Again, thanks for taking the time to help people, hopefully including myself!

AlexisWilke’s picture

grosseout, mchopra,

I would think that Brilliant Gallery could be fixed. It should not use those hard coded paths. It seems, however, that the index.php is a different problem from the wrong path.

I'm not the author, I repeat myself here... 8-) So I cannot fix the code in the CVS... Sorry! And I do not have much time here.

Thank you.

Maszie’s picture

my efford for today was to geht some thumbs to see anywhere - in this case I got them into the sidebar. This: was very helping very much. But I would like to have the gallery in a Node and tryed the following:




my hope was, that at least one would work ... filter seems to work, cause the "code" or how to call it is not visible. Also hat a look into the HTML - code.

Don't know if it's important - I'm using Drupal 6.10

The site:

The pic:

Maszie’s picture

AlexisWilke’s picture


Did you turn on the filter? (Input filter settings)

Thank you
Alexis Wilke

Maszie’s picture

have an own fiter for this gallery stuff ... tyed several tings like gallery filter only or gallery filter + HTML filter or gallery filter + HTML - filter + PHP ... in diferent orders and so on

Edit: the Tags disapear with the filter on and they are visible if I use the standart Filter ... so i guess the filter in general is working.

smartmark’s picture

Title: Brillant gallery doesn't show the thumbs ! » #6 works
smartmark’s picture

The remedy at #6 (plus deleting cache) works for me. Thanks!

aknxy’s picture

Title: #6 works » Brillant gallery doesn't show the thumbs !

I have Drupal 6.10 with Multilanguage support. When I turn to English Brilliant Gallery works. But when I select another language it is not displaying the thumbnails.

Anyone knows how to fix it?

Mercury500’s picture

No, it really does NOT work - consistently. (version 6.x users)

I've tried as many combos of fixes from various messages as I can. Don't waste your time.

I have drupal 6.9 and used both 3.0 and 3.0 dev version of this script.

Manage galleries works. GD works. Lightbox works.


This fix:
The solution is very easy. Just use drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); instead of drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE); inside the function drupalize() of image.php.

This fix (from #6):
cache_set($bgcacheid, $my_data, 'cache', time() + $bgcachexpire);

This fix:
Trying database cache or files cache option in settings.

It sometimes works (no reason, as in cache, but verifies GD and Lightbox)...I can get images from the brilliant_gallery node, but just X's from other folders in test nodes. AND for some reason, only 4 images will show when it does work. Why? I override default settings and still same thing - or rather - it gives 4 X's and where it used to show 4 images....uggh.

I'll tweak the images.php file and then revert back and then the brilliant_gallery page will not work. Caches cleared, same files, no other changes. No longer works. IE or FF.

Really, move along. Don't hang around here until Brilliant Gallery is REALLY fixed. Or at the very least, a definitive fix-it howto.

If anybody has gotten it to work on a late model Drupal, then please, give a shout with exact settings - and maybe upload your files (especially images.php) that work. None of that patch crap - the files are tiny.


AlexisWilke’s picture


I do agree that the code is quite ugly! But it works for me on that site:

And I'm running with 6.10 (started with 6.4 and worked with all the versions so far...)

And the only thing I had to do was to fix the cache() function call.

Thank you.
Alexis Wilke

aknxy’s picture

Besides multi language problem we noticed that it does not work on some of our computers but works on some others. Don't know the reason.

The best will be to move to Gallery2 I guess.

klucid’s picture

First of all, thank you all for your advice. It seems that a combination of these worked for a while, then suddenly stopped working.

I had to get into my settings.php file and add the following to get the thumbnails to work. Now BG is working perfectly!

ini_set('post_max_size', '8M');
ini_set('upload_max_filesize', '8M');
ini_set('memory_limit', '128M');

Hope this helps.

klucid’s picture

I would also like to link to the following node based on PHP's memory limits:

ericwongcm’s picture

5.87 KB

Well, I upgraded my Drupal 5 to 6 and found that Brilliant is not working properly again.
Found my way back here and finally fixed it.

Attached is the modified file, changed according to the instruction in #6.

You can simply overwrite your previous image.php with this file.
This is for 6.x-3.0.

(For those like me who didn't figure out how to use the patch on #22.)

Vacilando’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the feedback. Caching fixed in 6.x-3.3.

Status: Fixed » Closed (fixed)

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