Skip to content

Commit de3bc0c

Browse files
Added date info for iamges taken with camera
1 parent 701a74d commit de3bc0c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/ios/iosinterface.mm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ +( QString )handleCameraPhoto:( NSDictionary * )info :( NSString * )imagePath
161161
qWarning( "invalid compass, no GPS Direction" );
162162
}
163163

164+
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
165+
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]];
166+
NSDate *now = [NSDate date];
167+
[dateFormatter setDateFormat:@"yyyy:MM:dd"];
168+
[gpsDict setValue:[dateFormatter stringFromDate:now] forKey:( NSString * )kCGImagePropertyGPSDateStamp];
169+
[dateFormatter setDateFormat:@"HH:mm:ss"];
170+
[gpsDict setValue:[dateFormatter stringFromDate:now] forKey:( NSString * )kCGImagePropertyGPSTimeStamp];
171+
164172
return gpsDict;
165173
}
166174

0 commit comments

Comments
 (0)