X-Git-Url: http://git.scottworley.com/picsort/blobdiff_plain/59a0fba182b1c592474e3c3c01730917b51828ea..6219f116f895c5aedd312eb2f6f839be2a031d97:/picsorter.js?ds=sidebyside diff --git a/picsorter.js b/picsorter.js index 24cc893..fd8a8dc 100644 --- a/picsorter.js +++ b/picsorter.js @@ -41,11 +41,13 @@ function setpic() { display_filename = zoom + files[input_index]; } var $pic = $("#pic"); + $pic.on("load", function() { + $pic.removeClass("rot90 rot180 rot270"); + if ("rotate" in picinfo[files[input_index]]) { + $pic.addClass("rot" + picinfo[files[input_index]].rotate); + } + }); $pic.attr("src", display_filename); - $pic.removeClass("rot90 rot180 rot270"); - if ("rotate" in picinfo[files[input_index]]) { - $pic.addClass("rot" + picinfo[files[input_index]].rotate); - } } function say(message) {