Fix upload image resizer. (fixes #1375, #2471)

Polling the image height isn't reliable. Wait for the image to be fully
downloaded before resizing it instead.
This commit is contained in:
evazion
2016-12-18 20:42:24 -06:00
parent 3e285ea4ce
commit 78ca92c981

View File

@@ -8,7 +8,7 @@
}
if ($("#c-uploads").length) {
this.initialize_image();
$("#image").load(this.initialize_image);
this.initialize_info_bookmarklet();
this.initialize_similar();
$("#related-tags-button").trigger("click");
@@ -128,11 +128,6 @@
$("#scale").html("Scaled " + parseInt(100 * ratio) + "% (original: " + origin_width + "x" + origin_height + ")");
}
});
} else if (height === 0) {
if (!this.tries || this.tries < 10) {
this.tries = (this.tries || 0) + 1;
window.setTimeout(Danbooru.Upload.initialize_image, 200);
}
} else {
$("#scale").html("(original: " + width + "x" + height + ")");
}