cjbos
Forum Replies Created
-
Hey Jeremy,
I see it on a Macbook Pro Retina, in Chrome/Safari & Firefox.
It happens on every page we use photon images.
We see the error in the console, the error occurs every second.
This is the cause of the issue:
getImgSize: function (img_src) { var new_img = new Image(); new_img.onload = function() { var width = newImg.width; var height = newImg.height; } return [ width, height ]; }You can see the return from getImgSize where the width and height have not been defined.
getImgSize is called once, but the result is never used, so I think you can just remove this from the source?
I added this to the theme.php to disable the functionality until its fixed
add_action(‘wp_enqueue_scripts’, create_function(null, “wp_dequeue_script(‘devicepx’);”), 20);
Also this is the line that calls the function with the error
var img_sizes = t.getImgSize( img.src );
But img_sizes is not being used anywhere, I think you can just pull it out to fix the issue?