I'm having a random error trying to read raster size addressing paperscript variables from a js script .
This is the script...sometimes works, sometimes not. Either on Chrome and FF, trying to open the same images....quite strange
window.paper.project.activeLayer.removeChildren();
var imagePath = $('input[type=file]').val();
imagePath=imagePath.replace("C:\\fakepath\\","");
rastr = new window.paper.Raster(imagePath);
var wi=rastr.width;
var he=rastr.height;
var vw=window.paper.view.size.width;
var vh=window.paper.view.size.height;
if (he>wi) {
var scala=vh/he;
} else {
var scala=vw/wi;
}
window.paper.view.zoom=scala;
rastr.position =window.paper.project.view.center;
window.paper.project.view.draw();