首页 文章

使用EXIF数据从DJI Drone中检索图像

提问于
浏览
2

我正在iOS中使用DJISDK从飞机上下载图片 .

我正在使用 PlaybackManager 类的 downloadSelectedFiles 方法 .

这是我的进程回调:

process: { (data, error) in
    if data != nil{
        if self.downloadedImageData != nil{
            self.downloadedImageData!.append(data!)
        }else{
            self.downloadedImageData = data!
        }

    }
}

这是filecompletition回调:

fileCompletion: {
    self.downloadedFilesCount += 1
    let image = UIImage(data: self.downloadedImageData!)
    if let img = image {
        self.downloadedImagesArray?.append(img)
    }
    self.downloadedImageData = nil         
}

我正在检索图像但没有EXIF数据 . 如何获取该信息并将其添加到图像中?我已经下载并尝试了iOS-MediaManagerDemo,它是相同的,下载图像,但没有exif数据,但官方DJI Go应用程序检索所有信息,所以必须有一些方法来做到这一点 .

1 回答

  • 4

    关于空元数据还有similar issue in their forumsdownloadSelectedFilesWithPreparation . 创建帖子的用户也找到了解决方案:

    我通过不将NSData转换为任何格式而不是直接保存NSData来解决了这个问题 . 使用PHAssets和临时文件将NSData存储为PHAssets只接受来自URL的数据 .


    尝试使用fetchFileDataWithOffset:updateQueue:updateBlock(它将在Swift中被称为 fetchFileData(with:updateQueue:updateBlock)

    [...]获取媒体数据将返回视频或图像的所有数据

    示例代码(objc):here

相关问题