- boximg.style.position = "absolute";
- boximg.style.left = "0px";
- boximg.style.bottom = "-1px";
+function display_image(width, height, evt, filename, element_id)
+{
+ var url = window.location.origin + "/" + evt + "/" + width + "x" + height + "/nobox/" + filename;
+ var main = document.getElementById("iehack");
+ var preload = document.getElementById("preload");
+ var dpr = find_dpr();
+ var img;
+ // See if we have a preload going on that we can reuse.
+ if (element_id == "image" && preload !== null && preload.src == url) {
+ rename_element("preload_box", "image_box");
+ img = rename_element("preload", "image");
+ } else {
+ img = replace_image_element(url, element_id, main);
+ }
+ img.style.position = "absolute";
+ img.style.left = "0px";
+ img.style.top = "0px";
+ img.style.transformOrigin = "top left";
+ img.style.transform = "scale(" + (1.0 / dpr) + ")";
+
+ // Infobox.
+ var url;
+ if (dpr == 1) {
+ url = window.location.origin + "/" + evt + "/" + width + "x" + height + "/box/" + filename;
+ } else {
+ url = window.location.origin + "/" + evt + "/" + width + "x" + height + "@" + dpr.toFixed(2) + "/box/" + filename;