gpt4 book ai didi

ios - 使用 EXIF 数据从 DJI 无人机检索图像

转载 作者:可可西里 更新时间:2023-11-01 00:39:47 25 4
gpt4 key购买 nike

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

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

这是我的过程回调:

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

}
}

这是文件完成回调:

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 应用程序检索所有信息,因此必须有某种方法可以做到这一点。

最佳答案

还有一个 similar issue in their forums关于空元数据和 downloadSelectedFilesWithPreparation。创建帖子的用户也找到了解决办法:

I solved the problem by not converting the NSData into any format instead saved the NSData directly. Using PHAssets and temporary file to store the NSData as PHAssets only accepts data from URL.


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

[...] fetching the media data will return all data for a video or image


示例代码(objc):here

关于ios - 使用 EXIF 数据从 DJI 无人机检索图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45872030/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com