使用 EXIF 数据从 DJI 无人机检索图像
Retrieve images from a DJI Drone with EXIF data
我正在使用iOS中的DJISSDK从飞行器上下载图片。
我正在使用 PlaybackManager
class 中的 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
。创建 post 的用户
也找到了解决方法:
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中的DJISSDK从飞行器上下载图片。
我正在使用 PlaybackManager
class 中的 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
。创建 post 的用户
也找到了解决方法:
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