We use Lightbox2 together with Image module version 6.x-1.0-alpha4. Lightbox2 replaces the links to the image nodes created by Image module with links to the image files. If we set the display size to "preview" the Lightbox2 creates links to the preview version of the image files. But Image module does only create preview versions if the original image size is bigger than the preview size. Lightbox2 works alright (some "magic detecting thing" seems to be integrated) but people tend to open images in new tabs which does not work if the preview image doesn't exist. A workaround is to set the display size to "original" which slows down the site enormously.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | auto_image_handling.js_.linksunten.diff | 1.13 KB | linksunten |
| #6 | lightbox.js_.linksunten.diff | 1.53 KB | linksunten |
| #4 | auto_image_handling.js_.linksunten.diff | 1.15 KB | linksunten |
| #3 | auto_image_handling.js_.linksunten.diff | 1.12 KB | linksunten |
Comments
Comment #1
linksunten commentedComment #2
linksunten commentedThis is really important for us (and probably others, too) as it uses up a lot of our bandwidth and slows down the site enormously. Could someone please point us to the right code region, then we may try to solve it on our own.
Comment #3
linksunten commentedWe created a patch which should fix the issue.
Comment #4
linksunten commentedWe must admit: it's a bit trial and error but with this patch it works. Could someone please tell us if we broke something and it the patch fixes the problem for someone else, too?
Comment #5
Carlos Miranda Levy commented...
Comment #6
linksunten commentedNow this is not a trial and error patch, we really thought a lot about this module. We patched two files and this is what we did in detail:
After a node is loaded, all links to images (image module) are corrected, i.e. every infix display_image_size (e.g. ".preview") is deleted. This is done in auto_image_handling.js:
The function must be called again after the lightbox is closed which is done in end() in lightbox.js:
We do not want lightbox to show the original size of the image so we have to have a mechanism to find out which image has a display_image_size and which has not. We simply load the display_image_size first by adding an infix (e.g. ".preview") to all image links:
If a display_image_size does not exist then the error handler imgNodeLoadingError() loads the original size:
We hope that someone tests our patches and that the patches afterwards are merged into the next release.
Comment #7
kiwi_steve commentedThats magic, many thanks... it's working for me... not fully tested, but I'm getting images now which I wasn't before... seems like a huge oversight that this occured at all.
Steve
Comment #8
stella commentedI can't reproduce this issue with the latest dev version of the module with image module 6.x-1.0-beta5. Can you check out the latest code and confirm whether or not the problem persists?
Comment #9
stella commentedNo more info forthcoming