Unable to retrieve EXIF information from Cordova.

Asked 1 years ago, Updated 1 years ago, 114 views


Retrieved from Cordova (Ver.5.2.0) via cordova-plugin-camera I would like to get the image/jpeg EXIF information.

When I googled, I found "cordova-exif", loaded JS, and
The implementation is as follows.

navigator.camera.getPicture(onSuccess, onFail, options);

function onSuccess (imageURI) {
    CordovaExif.readData(imageURI, function(exifObject){
        alert(exifObject);
    });
}

"Also, the following settings were set to ""config.xml"" before the iOS 8 verification."

<preference name="CameraUsesGeolocation" value="true"/>

After checking the operation of the simulator and the actual machine in the above condition, the alert dialog is
I won't show it, maybe because of the presence or absence of EXIF information, I have EXIF information.

I also checked the jpeg file, but it still didn't work.

Do you need any new settings?
If you know how to solve this problem, please let me know.

javascript android ios cordova exif

2022-09-29 22:06

2 Answers

Let me check a little.

Do you import sources?

<script type="text/javascript" src="cordova-exif.js"></script>

Have you installed the plug-in that Cordova Exif requires??

cordova plugin add org.apache.cordova.camera
cordova plugin add org.apache.cordova.file

onSuccess Is the method itself not invoked?
(OnFail...)

function onSuccess(imageURI){
    console.log("funconSuccess"; // Log
    CordovaExif.readData(imageURI, function(exifObject){
        alert(exifObject);
    });
}
navigator.camera.getPicture(onSuccess, onFail, options);


2022-09-29 22:06

If you use JavaScript alert() in the callback function, you may experience problems.
https://docs.monaca.io/ja/reference/cordova_3.5/camera/


2022-09-29 22:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.