使用PowerShell从图像文件中提取GPS Latitude等(属性和详细信息) [英] Use PowerShell to extract GPS Latitude etc. (Properties > Details) from an image file
本文介绍了使用PowerShell从图像文件中提取GPS Latitude等(属性和详细信息)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一种从许多.jpg
文件中提取GPS纬度和经度值的方法。
我知道如何提取$img.FullName
等,但无法以这种方式访问Latitude。
推荐答案
要在没有外部工具的情况下访问您在Windows资源管理器中看到的元数据(不同于文件系统元数据),您必须使用Windows Image Acquisition (WIA) Automation Layer。你可以这样做:
# Create an ImageFile object and load an image file
$image = New-Object -ComObject Wia.ImageFile
$image.LoadFile("C:Absolutepath omy.jpg")
# Read your desirered metadata
$image.Properties.Item('GpsLatitude').Value
$image.Properties.Item('GpsLongitude').Value
请注意,与ExifTool或exiv2等外部工具相比,WIA的解析功能有限。但在您的案例中获取所需数据就足够了。
您可以阅读有关ImageFile
对象及其功能here的更多信息。
这篇关于使用PowerShell从图像文件中提取GPS Latitude等(属性和详细信息)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文