获取图片扩展信息

admin2020-12-03  2.5K+

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);
转载请注明原文地址: https://aardio.net/read-10.html
最新回复(0)
源码分享
aardio源码分享