Page 1 of 1

Image Lightbox doesn't work

PostPosted: 09.04.2015, 19:15
by younes
Hello,
Since I updated for 2.1.1, the image lightbox in "FIles" section doesn't work anymore...
Actually the lightbox works fine with pictures I uploaded with the older version of collabtive 1.2... but all pictures I uploaded since 2.1 doesnt show up in the lightbox... the loading icon can't stop spining and nothing shows up...
Any idea on how to fix this bug?
Thank you

Re: Image Lightbox doesn't work

PostPosted: 14.04.2015, 16:48
by younes
Hello everyone...
I still try to fix this bug but couldn't find any solution yet...
I came across this Topic on the Forum viewtopic.php?f=11&t=13180&hilit=image+uploaded
... it looks a bit similar to my problem except, in my case, when I rigthclick on the link to download the pic it works perfectly and I don't get any message saying that my file is corrupted...
It's only the lightbox that doesn't work... :/
I wanted to buy the plugin of collabtive but I first want to find a way to make this lightbox work...
Any idea on how to fix this bug?

Re: Image Lightbox doesn't work

PostPosted: 14.04.2015, 21:43
by Eva
What happens, when you try this in our online demo?
http://collabtive.o-dyn.de/demo

Re: Image Lightbox doesn't work

PostPosted: 15.04.2015, 11:33
by younes
Hello Eva!
Thank you for your message.
I tried on the Demo and I'm having exactly the same problem... So I tried with different browser and I realised that this bug concerns only Google CHROME :/
Any idea on how to fix this problem?
Thank you Eva

Re: Image Lightbox doesn't work

PostPosted: 19.04.2015, 11:30
by some person
I have investigated this and was able to reproduce this bug.

Chrome is reporting content length mismatch error.

I have looked at what collabtive is reporting for the content length/file size, and collabtive was reporting a wrong file size.

Thinking about it further, the only thing that I thought that could be happening is the file size, that was being reported by collabtive, must be the size of the encrypted file and not the original unencrypted file.

Looking at the file size of the encrypted file, I have confirmed that this is what is happening.

Collabtive is reporting the file size of the encrypted file, instead of the original unencrypted file, and Chrome is refusing to show the image.

On the other hand, Firefox, possibly other browsers, seems to take this wrong content length/file size without any problems and shows the image.

I haven't looked into a possible fix.

Re: Image Lightbox doesn't work

PostPosted: 20.04.2015, 10:54
by some person
I have come up with a quick fix for this.

Removing the reporting of content-length header field/file size, from collabtive, will have Chrome show/download the images in Lightbox.

To do this, open the managefile.php, found in the collabtive root, using a text editor, and remove the following line.

Code: Select all
header("Content-length: $fsize");

The the following line can also be removed, as the file size is not used/reported anymore, and there is no reason to run the filesize function.
Code: Select all
 $fsize =  filesize($filePath);

Re: Image Lightbox doesn't work

PostPosted: 20.04.2015, 11:03
by younes
Perfect! Thank you... This fix does the Job :)
Cheers

Re: Image Lightbox doesn't work

PostPosted: 21.04.2015, 01:46
by Eva
Thank you for providing the bug fix!
We have changed this in our repository, too, so it will be corrected in the next release. :)