使用EXIF数据从DJI无人机检索图像 [英] Retrieve images from a DJI Drone with EXIF data
问题描述
我在iOS中使用DJISDK从飞机上下载图片.
I'm using the DJISDK in iOS to download pictures from the aircraft.
我正在使用PlaybackManager
类中的downloadSelectedFiles
方法.
I'm using the downloadSelectedFiles
method from PlaybackManager
class.
这是我的流程回调:
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应用会检索所有信息,因此必须有某种方法可以做到.
I'm correctly retrieving the image but without the EXIF data. How can I get that info and add it to the image? I already downloaded and tried the iOS-MediaManagerDemo and it's the same thing, downloads the image but without the exif data but the official DJI Go app retrieves all the info so there´s must be some way to do it.
推荐答案
还有一个他们论坛中的类似问题,其中包含空白的元数据和downloadSelectedFilesWithPreparation
.创建帖子的用户
还找到了解决方案:
There's also a similar issue in their forums regarding empty metadata and downloadSelectedFilesWithPreparation
. The user that created the post
also found a solution:
我通过不将NSData转换为任何格式来解决问题,而是直接保存了NSData.使用PHAssets和临时文件将NSData存储为PHAssets仅接受URL中的数据.
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)
)
Try using fetchFileDataWithOffset:updateQueue:updateBlock (it will be called fetchFileData(with:updateQueue:updateBlock)
in Swift)
[...]提取媒体数据将返回视频或图像的所有数据
[...] fetching the media data will return all data for a video or image
Sample code (objc): here
这篇关于使用EXIF数据从DJI无人机检索图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!