获取图片扩展信息
By
netfox
at 2020-11-02 • 0人收藏 • 1150人看过
import console; import com path = "f:\IMG20200204223120.jpg"; getImageExtInfo = function( filePath , id = -1){ assert(io.exist(filePath),"输入的图片文件不存在,请检查!"); var image = io.splitpath(filePath); var path,file = image.dir,image.file; var shellApp = com.CreateObject("shell.application"); var dir = shellApp.nameSpace(path); var file = dir.parseName(file); if (id = -1){ var aProperty = {} for(i=1;35;1){ aProperty[dir.getDetailsOf(,i)] = dir.getDetailsOf(file,i); } return aProperty; }else{ sProperty = dir.getDetailsOf(file,id) if(#sProperty){ return sProperty; }else { return "没有获取到扩展Id:" ++ id ++ " 相应的扩展属性!"; } } } console.dump(getImageExtInfo(path)) console.pause(true);
登录后方可回帖