Skip to content

Instantly share code, notes, and snippets.

@thekarel
Created September 24, 2013 16:15
Show Gist options
  • Save thekarel/6687206 to your computer and use it in GitHub Desktop.
Save thekarel/6687206 to your computer and use it in GitHub Desktop.
// Get on screen image
var screenImage = $("#image");
// Create new offscreen image to test
var theImage = new Image();
theImage.src = screenImage.attr("src");
// Get accurate measurements from that.
var imageWidth = theImage.width;
var imageHeight = theImage.height;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment