Hello,
Unfortunatelly it is a bug in current version. We're sorry for the inconvenience.
However, there is quite simple workaround.
The problem is really in the mentioned part of the condtion in
MediaFilePreview.ascx.cs, line #153.
You will need to change it from
File.Exists(mfi.FilePath) to
File.Exists(MediaFileInfoProvider.GetMediaFilePath(mfi.FileLibraryID, mfi.FilePath))Please see the resulting code below (rendering code under "//lightbox mod" comment):
...
if (this.DisplayActiveContent)
{
if (ImageHelper.IsImage(mfi.FileExtension) && File.Exists(MediaFileInfoProvider.GetMediaFilePath(mfi.FileLibraryID, mfi.FilePath)))
{
// Images are always processed by secure page
if (!this.UseSecureLinks)
{
if (completeUrl)
{
url = MediaFileInfoProvider.GetMediaFileAbsoluteUrl(si.SiteName, mfi.FileGUID, mfi.FileName);
}
else
{
url = MediaFileInfoProvider.GetMediaFileUrl(mfi.FileGUID, mfi.FileName);
}
}
//lightbox mod
int[] dim = ImageHelper.EnsureImageDimensions(Width, Height, MaxSideSize, mfi.FileImageWidth, mfi.FileImageHeight);
Width = dim[0];
Height = dim[1];
this.ltlOutput.Text = "<a href=\"" + url + "\" rel=\"lightbox[gallery]\" title=\"" + mfi.FileTitle + "\"><img src=\"" + url + "\" border=\"0\" width=\""+Width+"\" height=\""+Height+"\" /></a>";
}
else ...
...
There are some differences from the tutorial in devguide, the 3 lines of code under "lightbox mod" serve just to ensure that image dimension variables are properly set (and they're used in modified output text).
Notes:
1) Ensure you have enabled the "Display active content" property for the Image Gallery webpart.
2) You could use webpart General/ HeadHTML webpart to link lightbox scripts, and it's recommended to use separate scripts, not these from Lightbox webpart's files folder.
Hope this helps.
Regards,
Zdenek C.