It might not be fast as you need to parse all of the jpg as there may be thumbnails embeded.
Code: Select allString.prototype.WidthHeight = function(pos){
var wh = new Array();
var hi = this.charCodeAt(pos);
var lo = this.charCodeAt(pos+1);
wh.push( (hi << 8) + lo);
hi = this.charCodeAt(pos+2);
lo = this.charCodeAt(pos+3);
wh.push( (hi << 8) + lo);
return wh;
}
function main(){
var folder = Folder.selectDialog( "Please select input folder");
if(folder == null ) return;
var JPGS = folder.getFiles("*.jpg");
var Info = new Array();
for(var a in JPGS){
var file = JPGS[a];
file.open('r');
file.encoding='BINARY';
var filedata = file.read();
file.close();
var pos = new Array();
var RE = /\xFF\xC0/g;
while(match = RE.exec(filedata)){pos.push(match.index);}
var position = (pos[Number(pos.length-1)]);
var HeightWidth = filedata.WidthHeight(position+5);
Info.push([[decodeURI(file.name)], [HeightWidth[1]],[HeightWidth[0]]]);
filedata=null;
}
$.writeln(Info.join('\r'));
}
main();