I'm interested in setting GPS location metadata to captured images in QML. I noticed the setMetadata(key,value) method in several qml capture elements but I can't understand how it works, or find any examples.
The definition in the documentation states:
"Sets a particular metadata key to value for the subsequent image captures."
http://qt-project.org/doc/qt-5/qml-qtmultimedia-cameracapture.html
Does the method work? if so, please place a simple example. If not, is there any other way to set (or edit) image metadata (even if use of C++ is necessary) in Qt?
Update (but not solved): I've tried the following code, the app runs on desktop takes the picture and saves it. After I open it up with Preview (MAC) and check the metadata... and nothing special there (no comment key).
Camera {
id: camera
captureMode: Camera.CaptureStillImage
Component.onCompleted: {
imageCapture.setMetadata("Comment","My Picture")
}
imageCapture {
resolution: "640x480"
onImageCaptured: {
console.log("Image Captured Callback : Preview : "+preview)
}
onImageSaved: {
console.log("Image Saved Callback : Save Path : "+path)
}
onImageMetadataAvailable: {
console.log("Image Metadata Callback : "+key+" = "+value)
}
}
}