Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
Upon troubleshooting, it was found that when an image throws an error, this inside the callback refers to the image element and not the JustifiedGallery instance. This causes a TypeError because this.resetImgSrc is not a function in the context of the image element.
To resolve this, I ensured that this correctly refers to the JustifiedGallery instance by using .bind(this) on the callback function.
Upon troubleshooting, it was found that when an image throws an error, this inside the callback refers to the image element and not the JustifiedGallery instance. This causes a TypeError because this.resetImgSrc is not a function in the context of the image element.
To resolve this, I ensured that this correctly refers to the JustifiedGallery instance by using .bind(this) on the callback function.
Also might help resolve: https://github.com/miromannino/Justified-Gallery/issues/333, https://github.com/miromannino/Justified-Gallery/issues/351