如何在不干扰C ++ .net中的其他Exif数据的情况下删除JPEG图像的Thumbnail属性

时间:2010-06-05 14:01:23

标签: .net c++-cli

我有一个应用程序可以编辑JPEG图像的元数据部分。我必须删除缩略图元数据,而不用干扰其他元数据。我已经尝试了下面的代码,但没有成功删除缩略图元数据。我可以提前帮助我解决这个问题。

array<String^>^ query = gcnew array<String^>(4);

query[0] = "/app1/ifd/tiff:";
query[1] = "/app1/ifd/tiff/subifd:";
query[2] = "/ifd/tiff:";
query[3] = "/ifd/tiff/subifd:";

for each (String^ SetQuery in query)
{
 metaData->RemoveQuery(SetQuery + "{uint=256}");
 metaData->RemoveQuery(SetQuery + "{uint=257}");
 metaData->RemoveQuery(SetQuery + "{uint=258}");
 metaData->RemoveQuery(SetQuery + "{uint=259}");
 metaData->RemoveQuery(SetQuery + "{uint=273}");
 metaData->RemoveQuery(SetQuery + "{uint=262}");
 metaData->RemoveQuery(SetQuery + "{uint=277}");
 metaData->RemoveQuery(SetQuery + "{uint=278}");
 metaData->RemoveQuery(SetQuery + "{uint=279}");
 metaData->RemoveQuery(SetQuery + "{uint=282}");
 metaData->RemoveQuery(SetQuery + "{uint=283}");
 metaData->RemoveQuery(SetQuery + "{uint=284}");
 metaData->RemoveQuery(SetQuery + "{uint=296}");
 metaData->RemoveQuery(SetQuery + "{uint=513}");
 metaData->RemoveQuery(SetQuery + "{uint=514}");
 metaData->RemoveQuery(SetQuery + "{uint=529}");
 metaData->RemoveQuery(SetQuery + "{uint=530}");
 metaData->RemoveQuery(SetQuery + "{uint=531}");
 metaData->RemoveQuery(SetQuery + "{uint=532}");
}

1 个答案:

答案 0 :(得分:1)

Phil Harvey的 ExifTool <{3}}会帮助你吗?如果您需要了解它是如何完成的,可以使用Perl源。