Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
when using lightbox2 and brilliant gallery and i expand the image, it always expands the image to the maximumm width size in the brilliant gallery configuration settings. i cannot view the image in its original state.
example when i set the max width option to 1920. i proceed to view a 'wallpaper' in expanded mode (which is 1280x1024) it will always blow it up to a width of 1920 which does not work when trying to display a wallpaper for a user to download
Comment | File | Size | Author |
---|---|---|---|
#11 | brilliant_gallery-original_size_issue-361202-11.patch | 3.62 KB | mibfire |
Comments
Comment #1
gilgabar CreditAttribution: gilgabar commentedI'm having the same issue. I just upgraded from 6.x-1.2 to 6.x-3.0. It did not have any problem with image sizing in the previous version, so it seems likely it is due to a bug introduced in the most recent version. I don't have time to troubleshoot at the moment, so hopefully someone else can figure it out.
Comment #2
gilgabar CreditAttribution: gilgabar commentedIt looks like the problem is around lines 750 -757 in brilliant_gallery.module:
It looks like in the previous versions there was some logic there that decided whether the image was bigger than the maxwidth. If it was, then it applied the maxwidth dimensions instead of the original dimensions, effectively shrinking it to fit. Otherwise it would use the original dimensions. It looks like it is commented out in the current version which causes the maxwidth dimension to always be applied, effectively blowing it up if it is smaller.
While uncommenting it doesn't appear to restore functionality entirely, it is possible to get the old functionality back if you uncomment line 751 and comment out line 757. It will no longer apply the maxwidth to larger images, but if you have either manually scaled all your images anyway or are using the auto scaling feature in lightbox, then it should not be a problem and good enough for the short term until someone can make a real fix.
Comment #3
mike69 CreditAttribution: mike69 commentedHi have got the same problem and the uncommenting does not help. It is not enough, I found some more places which have to be uncommented:
Look into the functions.inc and locate "function load_dir_to_array" and uncomment from:
into:
After that, I can see now small images in their original size ...
Ciao,
Mike
Comment #4
apprayo CreditAttribution: apprayo commentedChanging the code as suggested by both gilgabar and mike69 didn't work for me.
I found another thing to do. I did mike69 suggestion, plus this one:
Change this code in brilliant_gallery.module (at about line 734)
Into this code:
By this way, we set the images in the browser (I use lightbox) in their original size.
Hope this helps.
Comment #5
jefftrnr CreditAttribution: jefftrnr commentedThe code that was commented out would be useful if it used the $retval_dimensions array, which may have been introduced in the previous change? Here is my "patch" which seemed to fix the problem.
This may be a better fix than comment #4 since it still preserves the code that sets an image that's too large to the max-width size. Hopefully it's closer to what the author intended. Please test it and if we can make it into a patch, possibly we'll something like this fix it in the next version.
Comment #6
drewbul CreditAttribution: drewbul commentedIn the latest version of BG (6.x-3.6), which was released (2009-Oct-29) after the last comment here (2009-Sep-09), the problem still exists, but all the suggested patches either are not applicable or do not work. I would gladly sacrifice this functionality at all, as suggested in comment #2. I would also be happy if the lightbox simply had fullimgpath as src (no resizing - less server load). Tried to do that but failed - no PHP skill :(.
Please suggest a solution.
Comment #7
DreeStyler CreditAttribution: DreeStyler commentedHi,
maybe too later, but for another dummies like me:
I cannot find any patches right now.
Even though the version(Brilliant gallery 6.x-3.6) matches version mentioned in this solutions, it is not he same. The lines 750-757 do not matches with line numbers of "newer version", but code is still the same in the response of #2 Gilgabar.
This will do that link generated on all of pictures will be headed to original path of picture(e.g. /files/bg_images/kyberia_vykradacka/art/1194216322_06(2).jpg) instead of generating link with attributes for resizing influenced by max width.
If you want to repair this bug, replace this piece of code with code above:
#if ($smallenough != true) {
$result .= ' #}
#else {
# Important to begin with the "/" otherwise thumbnails in non-root folders fail. See http://drupal.org/node/175292
#$result .= ' #&dummy=.jpg
#$result .= ' #}
You can see diferences in second(start with $result) and last(start with #$result) line of the code.
Thank you Gilgabar.
Comment #8
AdamTS CreditAttribution: AdamTS commentedHello, I basically just tossed out the resizing feature because I pre-scale my images the way I need them anyway. See below (starting at line 38 of functions.inc).
Adam
-----------
www.mindwave.ch
Comment #9
postak CreditAttribution: postak commentedseems that the issue is present also in 7.x-1.2 version
will try some workarounds...
EDIT:
seems that workaround #8 from AdamTS works
btw, if you use Picasa as a source, by default it sends quite small pictures via RSS feed, so the http call needs to be extended with parameter imgmax, e.g. "&imgmax=1600" (leaves smaller originals and crops big pictures)
EDIT2:
I don't know PHP, but it seems to me, that working (and corrected) solution could be:
Comment #10
gemp CreditAttribution: gemp commentedStill an issue in 7.x-1.8 (also -dev).
Couldn't make the above solutions work, so I found a simpler one. It simply removes the large image scaling, replacing its computed image path by the one of the original image.
brilliant_gallery_manage.inc line 132 and
brilliant_gallery_showtime.inc line 500 replace:
$displayimage .= '<a href="' . $imgsrc . '"';
by
$displayimage .= '<a href="' . $fullimgpath . '"';
And below, replace the rel prefix
bg-
by something else, it seems to cause problems (didn't try with lightbox):Also, if your site uses i18n, you have to add the correct definition in brilliant_gallery.module, because
i18n_get_lang
is deprecated. Change:to
Comment #11
mibfire CreditAttribution: mibfire commentedI made a patch for this #9 comment.