henrygd / bigger-picture

JavaScript lightbox gallery for images, video, audio, iframes, html. Zoomable, responsive, accessible, lightweight.
https://biggerpicture.henrygd.me
MIT License
231 stars 17 forks source link

undefined thumbnails generate 404s #41

Closed ellemenno closed 9 months ago

ellemenno commented 9 months ago

if I don't define the data-thumb attribute, a fetch is still attempted on the undefined string value, resulting in a 404:

GET http://<my-site>/undefined 404 (Not Found)

in my use case, I am opening a gallery of images from a text link, so no thumbnail needed or wanted. but, to prevent the errors, I've needed to specify the attribute for every gallery item. I created a generic image that can be reused for all, but this is a lot of redundancy for something I don't think I need. Could one of the following be implemented instead?

  1. (preferred) add a value check for data-thumb, and don't try to fetch when undefined
  2. provide a global option to set a default value, so it doesn't need to be specified on every gallery item

everything else has been really smooth, thank you for providing this! it was simple to integrate, works well, and looks nice. also the css structure has made tweaking the caption and counter fonts easy to do.

henrygd commented 9 months ago

Glad it's working well for you. This should be fixed now in 1.1.14.