cbeyls / slimbox

The ultimate lightweight Lightbox clone
http://www.digitalia.be/software/slimbox2
50 stars 24 forks source link

Doesn't seem to work on images with parentheses #25

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use an image with a parentheses in the filename, 'xyz (1).jpg' for example
2. Load slimbox
3. The image will not be displayed

What is the expected output? What do you see instead?
Instead of the image being loaded, a blank empty white box is displayed. If 
multiple images are present in the list, sometimes the other images are 
repeated.

What version of the product are you using? On what operating system?
2.04

Please provide any additional information below.

Original issue reported on code.google.com by donniel on 11 Nov 2010 at 1:19

GoogleCodeExporter commented 9 years ago
Same issue, all images with parentheses aren't loaded, and with quotes too.

Original comment by aurelien...@gmail.com on 1 Feb 2011 at 7:35

GoogleCodeExporter commented 9 years ago
I've also found this issue. A fix is to change the slimbox2.js javascript file.
There is a piece in the code where the setting of the background image property 
is failing.

Current code is -

.css({backgroundImage:"url("+n+")"

Adding single quote around the url will fix this issue. eg.

.css({backgroundImage:"url('"+n+"')"

Hope this helps.

Original comment by jamesh...@hotmail.com on 22 Feb 2011 at 4:35

GoogleCodeExporter commented 9 years ago
Funcionou! Obrigado pela ajuda!
It works! Thanks for help.

From Brazil.

Original comment by cis...@gmail.com on 26 Jul 2012 at 1:07

GoogleCodeExporter commented 9 years ago
This fixed the problem perfectly!  Thank you!!

Original comment by nonea...@gmail.com on 30 Mar 2013 at 12:17

GoogleCodeExporter commented 9 years ago
@jamesh Nice fix thank you very much. Had the same problem, you saved me a 
really bad headache :) 

Original comment by johnatha...@gmail.com on 14 Feb 2014 at 5:04

GoogleCodeExporter commented 9 years ago
@jamesh I had to rename more than a 1000 of pictures. You saved me hours of 
work. Thanks a lot!

Original comment by Evangelo...@gmail.com on 19 Sep 2014 at 7:30

cbeyls commented 9 years ago

This workaround will work but the root cause is that parenthesis are invalid characters in URLs. Maybe I'll add the additional quotes in a future version.

GDmac commented 7 years ago

Parenthesis are valid !!! /img/funnycat_(1).jpg is valid !!!

... only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL. http://www.ietf.org/rfc/rfc1738.txt

GDmac commented 7 years ago

ps. edit in filenames they're valid