English 中文(简体)
如何从摄像机的滚动图像中提取光元和几何信息? [复制]
原标题:iPhone iOS how to extract photo metadata and geotagging info from a camera roll image? [duplicate]
This question already has answers here:
Closed 11 years ago.

Possible Duplicate:
How Do I Get The Correct Latitude and Longitude From An Uploaded iPhone Photo?

我会提供照片,并想知道我有哪些选择与地标照片合作。 www.un.org/Depts/DGACM/index_french.htm 这是可能的吗?

此外,<> 我需要知道什么时候用了。 我可以抓住这一信息,了解我亲眼的照片,但照相机的图像是什么?

最佳回答

是的,这是可能的。

您必须使用ALAssetsLibrary进入你的照相机。 然后,你就通过你的照片进行点名,并要求地点。

assetsLibrary = [[ALAssetsLibrary alloc] init];
groups = [NSMutableArray array];

[assetsLibrary enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos  usingBlock:^(ALAssetsGroup *group, BOOL *stop)
{
    if (group == nil)
    {
        return;
    }

    [groups addObject:group];

} failureBlock:^(NSError *error)
{
    // Possibly, Location Services are disabled for your application or system-wide. You should notify user to turn Location Services on. With Location Services disabled you can t access media library for security reasons.

}];

这将列举你们的资产集团。 其次,你挑选小组并列举其资产。

ALAssetGroup *group = [groups objectAtIndex:0];
[group enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop)
 {
     if (result == nil)
     {
         return;
     }

     // Trying to retreive location data from image
     CLLocation *loc = [result valueForProperty:ALAssetPropertyLocation];    
 }];

如今,<代码>loc变量包含带照片的地点。 您在使用前应对照<代码>ALErrorInvalidProperty进行核对,因为一些照片可能缺乏这一数据。

您可具体说明,以获得照片制作的日期和时间。

问题回答

暂无回答




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签