You're gonna want to preload the image.
var background = new Image();
background.src = "your-image.jpg";
var bgHeight = background.height;
var bgWidth = background.width;
Alright, here's the real answer. It took some thinking, and some borrowing of code from this answer: How can I determine the background image URL of a div via JavaScript?
But, I finally got it. I see you wanted a jQuery answer, but I work only in Native, JS, so sorry about the disconnect.
EDIT: I found some missing logic, so I threw it in. Now it should be good to go, hopefully.
http://jsfiddle.net/TLQrL/2/ - New link reflecting new logic
var div = document.getElementById("myDiv");
var style = div.currentStyle || window.getComputedStyle(div, false);
var bg = style.backgroundImage.slice(4, -1);
var background = new Image();
background.src = bg;
background.onload = function() {
if (background.width > background.height) {
var ratio = background.height / background.width;
if (div.offsetWidth > div.offsetHeight) {
var bgW = div.offsetWidth;
var bgH = Math.round(div.offsetWidth * ratio);
if (bgH < div.offsetHeight) {
bgH = div.offsetHeight;
bgW = Math.round(bgH / ratio);
}
} else {
var bgW = Math.round(div.offsetHeight / ratio);
var bgH = div.offsetHeight;
}
} else {
var ratio = background.width / background.height;
if (div.offsetHeight > div.offsetWidth) {
var bgH = div.offsetHeight;
var bgW = Math.round(div.offsetHeight * ratio);
if (bgW > div.offsetWidth) {
bgW = div.offsetWidth;
bgH = Math.round(bgW / ratio);
}
} else {
var bgW = Math.round(div.offsetWidth / ratio);
var bgH = div.offsetWidth;
}
}
console.log(bgW + ", " + bgH);
}