Justified Gallery errors handling

In the new version of Justified Gallery the errors are handled in a very smart way, without hurting the user with strange messages.

The rules are simple:

  • The plugin try to load the given thumbnail. In case of an error the plugin ignores the thumbnail, and continue to build the layout with the other thumbnails.
  • If the plugin needs a different thumbnail (e.g. a bigger one) that can't be loaded, it simply leaves the old one.

Note that the errors are still visible in the console.

Remember: it is not the best way to manage galleries with only one kind of thumbnail.

In the following example we have a gallery with 5 thumbnails, where one of them is inexistent. This thumbnail is ignored and is not shown in the gallery. Furthermore, the plugin requests a bigger thumbnail for the image onlythethumbnail_t.jpg, but this is the only existent thumbnail. Hence, the plugin leaves the original one (the low quality image in the example).

<div id="notFoundExample" >
	<a href="photos/8083451788_552becfbc7_b.jpg" title="What's your destination?">
		<img alt="What's your destination?" src="photos/8083451788_552becfbc7_m.jpg" />
	</a>
	<a href="photos/INEXISTENT_IMAGE.jpg" title="INEXISTENT_IMAGE">
		<img alt="Just in a dream Place" src="photos/INEXISTENT_IMAGE_t.jpg" />
	</a>
	<a href="photos/7302459122_19fa1d8223_b.jpg" title="Truthful Innocence">
		<img alt="Truthful Innocence" src="photos/7302459122_19fa1d8223_m.jpg" />
	</a>
	<a href="photos/onlythethumbnail_t.jpg" title="This is the colors I love">
		<img alt="This is the colors I love" src="photos/onlythethumbnail_t.jpg" />
	</a>
	<a href="photos/7302459122_19fa1d8223_b.jpg" title="Truthful Innocence">
		<img alt="Truthful Innocence" src="photos/7302459122_19fa1d8223_m.jpg" />
	</a>
</div>

$('#notFoundExample').justifiedGallery();