Working on a site that uses flexbox CSS layout, I ran into an issue where only the lowest-resolution image would get loaded, even after resizing.
I narrowed it down to image.parentNode.clientWidth always returning zero in the determineAppropriateResolution function.
Adding a second fallback to offsetWidth seems to fix the issue:
Imager.prototype.determineAppropriateResolution = function (image) {
return Imager.getClosestValue(image.getAttribute('data-width') || image.parentNode.clientWidth || image.parentNode.offsetWidth, this.availableWidths);
};
My problem isn't completely fixed- it still doesn't initially load the correct size image, but this seems to be an important step on the way.