我正在尝试确定从其 EXIF 数据中读取的图片的时区(以转换以 UTC 格式拍摄的日期)。我试着拍照然后检查它的元数据:
{
ColorModel = RGB;
DPIHeight = 72;
DPIWidth = 72;
Depth = 8;
Orientation = 6;
PixelHeight = 1936;
PixelWidth = 2592;
"{Exif}" = {
ApertureValue = "2.970854";
BrightnessValue = "-2.571174";
ColorSpace = 1;
ComponentsConfiguration = (
1,
2,
3,
0
);
DateTimeDigitized = "2012:12:13 01:21:55";
DateTimeOriginal = "2012:12:13 01:21:55";
ExifVersion = (
2,
2,
1
);
ExposureMode = 0;
ExposureProgram = 2;
ExposureTime = "0.06666667";
FNumber = "2.8";
Flash = 16;
FlashPixVersion = (
1,
0
);
FocalLenIn35mmFilm = 35;
FocalLength = "3.85";
ISOSpeedRatings = (
1000
);
MeteringMode = 5;
PixelXDimension = 2592;
PixelYDimension = 1936;
SceneCaptureType = 0;
SensingMethod = 2;
ShutterSpeedValue = "3.9112";
SubjectArea = (
1295,
967,
699,
696
);
WhiteBalance = 0;
};
"{GPS}" = {
Altitude = "258.794";
AltitudeRef = 0;
ImgDirection = "24.38477";
ImgDirectionRef = T;
Latitude = "45.02183333333333";
LatitudeRef = N;
Longitude = "7.610833333333334";
LongitudeRef = E;
TimeStamp = "00:21:53.87";
};
"{TIFF}" = {
DateTime = "2012:12:13 01:21:55";
Make = Apple;
Model = "iPhone 4";
Orientation = 6;
ResolutionUnit = 2;
Software = "6.0.1";
XResolution = 72;
YResolution = 72;
"_YCbCrPositioning" = 1;
};
}
它似乎有本地时间(DateTimeOriginal)和UTC时间({GPS}->TimeStamp),但没有迹象表明这两者之间的偏移量。我可以做一些事情来确定 DateTimeOriginal 和 TimeStamp 之间的区别,但是第二个没有日期,所以如果它们跨越两个不同的日子,这似乎很棘手。
有没有办法获得完整的 UTC 日期,或时区的当地时间?
我也在考虑从纬度/经度数据中确定时区,但这似乎也很复杂,因为它涉及使用外部服务从坐标中获取国家/地区。