He conseguido ajustar el tamaño:
Código:
<form>
<script type="text/javascript">
function foto(img)
{ var arch = "file:///" + img.replace(/\\/g,"/")
arch = arch.replace(/ /g,"%20")
document.getElementById("foto_view").style.backgroundImage = "url("+arch+")"
var imag = new Image()
imag.src = arch
document.getElementById("foto_view").style.width = imag.width + "px"
document.getElementById("foto_view").style.height = imag.height + "px"
}
</script>
Elige imagen<input type="file" onChange="foto(this.value)">
<div id="foto_view" style="width:2px; height:2px;"></div>
</form>
Falla algunas veces, no sé muy bien por qué; quizás dependa del nombre y ruta; he filtrado los espacios y ha ayudado, pero aún algunos fallan.