Image size not being picked up on webkit, once
So I seem to have an issue I'm really stuck with because I can only get the error to happen once. No matter what I do, I can't get it to replicate, but I've had a few people try it on their systems and they all got the issue (with an exception I'll explain lower), but again, only once. I've tried clearing my cache, resetting Safari, but no avail.
So the bug only happens on webkit (tested on latest Safari and Chrome).
I've written a simple image zoomer script (zoom of image appears to the side of the image based on mouse location). It starts by getting the image height/width (using .width() and .height()), wrapping the image in a span, and making that span an inline-block and giving it the height/width of the image.
Unfortunately, on the first load in both safari and chrome, the width and height set to 0. If you refresh, they set correctly, and on every other refresh ever. Clearing the cache or doing a force load don't seem to do anything to allow the issue to replicate so I can't even test out how to fix it.
Anyone have any thoughts on whats wrong? How I can replicate the bug? How I can prevent the bug from happening again?