Why don't you use TimThumb? To be honest, it doesn't seem like you need to AJAX request the server at all.
What this code does it creates a hidden img on the page, stores it's width and height as variables, works out which is bigger (width or height), then returns a cropped img.
You will need timthumb.php in your base directory for this code to work. I've changed your original DIV element to an IMG element as obviously DIV's cannot receive a SRC attribute to be turned into an image (you could of course alter the code below to output the image as a background-image of a DIV though).
$("img[data-img-src]").each( function() {
imgSrc = $(this).attr("data-img-src");
$('body').append('<img class="hidden-img" src="'+imgSrc+'" style="visibility:hidden;>');
imgWidth = $('.hidden-img').outerWidth();
imgHeight = $('.hidden-img').outerHeight();
imgString = '/timthumb.php?src='+imgSrc;
if(imgWidth > imgHeight){
imgString = imgString+'&h=200&q=90';
} else {
imgString = imgString+'&w=200&q=90';
}
$('.hidden-img').remove();
$('body').append('<img src="'+imgString+'">');
});
</script>