darickc / MMM-BackgroundSlideshow

MIT License
143 stars 80 forks source link

Spaces in filenames do not work #12

Closed 1dollarbob closed 5 years ago

1dollarbob commented 5 years ago

To reproduce, point the imagePath to a directory (e.g., "modules/pictures") with recursiveSubDirectories=true. Inside that path, have a subdir with spaces (e.g., "modules/pictures/e xamp le directory") and inside that put some pictures. The module fails to find these pictures and appears to crash when this setup is used.

FYI, it is also broken in the ImageSlideshow module where some of the code came from

1dollarbob commented 5 years ago

to fix this, change line 142 of the main js file to encode the src of the image

image.src = this.imageList[this.imageIndex];

becomes image.src = encodeURI(this.imageList[this.imageIndex]);

darickc commented 5 years ago

I've added it but I haven't tested it.

dvenza commented 3 years ago

Unfortunately no, it does not work. I get 404 errors in the console when the file is in a subfolder (recursive=true) with spaces in it.

rakuri255 commented 3 years ago

I also getting this error