0
我想读取jpg文件的属性。 以下是我迄今为止所做的,但我无法获得图像中显示的属性“A”。我从下面得到的函数是带有ASCII &数值的字符串列表。从jpg文件中读取扩展图像属性
static void ReadProperties(Image imgImage)
{
var listImageProperties =new List<string>();
try
{
PropertyItem[] propItems = imgImage.PropertyItems;
foreach (PropertyItem propItem in propItems)
{
listImageProperties.Add("0x" + propItem.Id.ToString("x"));
listImageProperties.Add(propItem.Type.ToString());
listImageProperties.Add(propItem.Len.ToString());
}
}
catch (Exception ex)
{
}
}
请注意,'属性'是文件系统的概念,与Exif无关。如果您还想从图像中读取Exif信息,请查看我的[metadata-extractor](https://github.com/drewnoakes/metadata-extractor-dotnet)库,它将读取您的各种元数据图像和视频文件。 –