C++ 为什么我无法将GpsLongitude正确设置为exif?

C++ 为什么我无法将GpsLongitude正确设置为exif?,c++,gps,exif,C++,Gps,Exif,我有以下代码: PropertyItem propertyItem; int degree = 10, minutes = 10, second = 10; unsigned long ulExifCoordFormat[6] = {degree, 1, minutes, 1, second, 1}; propertyItem.id = PropertyTagGpsLongitude; propertyItem.type=PropertyTagTypeRational; propertyItem

我有以下代码:

PropertyItem propertyItem;
int degree = 10, minutes = 10, second = 10;
unsigned long ulExifCoordFormat[6] = {degree, 1, minutes, 1, second, 1};
propertyItem.id = PropertyTagGpsLongitude;
propertyItem.type=PropertyTagTypeRational;
propertyItem.length = sizeof( unsigned long ) * 6;
propertyItem.value =ulExifCoordFormat;
bitmap->Setproperty(&propertyItem);
此代码应将
经度设置为10,10,10,
但将其设置为一些错误的值

用于设置纬度的类似代码也可以正常工作:

PropertyItem propertyItem;
int degree = 20, minutes = 20, second = 20;
unsigned long ulExifCoordFormat[6] = {degree, 1, minutes, 1, second, 1};
propertyItem.id = PropertyTagGpsLatitude;
propertyItem.type=PropertyTagTypeRational;
propertyItem.length = sizeof( unsigned long ) * 6;
propertyItem.value =ulExifCoordFormat;
bitmap->Setproperty(&propertyItem);
代码基于此MSDN文档:

这篇文章:

编辑1 我只是注意到,这取决于我先设置了哪一个。第一个设置正确,第二个设置不正确。显然,我只能用这个函数添加一项。如何同时设置多个项目