Dump exif data after taking picture
This commit is contained in:
parent
4760c1e491
commit
3abd68f5f3
|
@ -111,8 +111,8 @@ mobile.ble.onError = function (err) {
|
||||||
};
|
};
|
||||||
|
|
||||||
mobile.init = function () {
|
mobile.init = function () {
|
||||||
const bleInputs = document.querySelectorAll('.ble')
|
const bleInputs = document.querySelectorAll('.ble');
|
||||||
document.querySelector('body').classList.add('mobile')
|
document.querySelector('body').classList.add('mobile');
|
||||||
|
|
||||||
window.frame = mobile.frame;
|
window.frame = mobile.frame;
|
||||||
window.getState = mobile.getState;
|
window.getState = mobile.getState;
|
||||||
|
@ -419,7 +419,7 @@ mobile.setWifiSuccess = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
mobile.getCamera = function () {
|
mobile.getCamera = function () {
|
||||||
var opts = {
|
const opts = {
|
||||||
quality: 30,
|
quality: 30,
|
||||||
sourceType: Camera.PictureSourceType.CAMERA,
|
sourceType: Camera.PictureSourceType.CAMERA,
|
||||||
destinationType: Camera.DestinationType.FILE_URI
|
destinationType: Camera.DestinationType.FILE_URI
|
||||||
|
@ -427,8 +427,8 @@ mobile.getCamera = function () {
|
||||||
navigator.camera.getPicture(mobile.cameraSuccess, mobile.cameraError, opts);
|
navigator.camera.getPicture(mobile.cameraSuccess, mobile.cameraError, opts);
|
||||||
};
|
};
|
||||||
mobile.cameraSuccess = function (result) {
|
mobile.cameraSuccess = function (result) {
|
||||||
var thisResult = JSON.parse(result);
|
const thisResult = JSON.parse(result);
|
||||||
var metadata = JSON.parse(thisResult.json_metadata);
|
const metadata = JSON.parse(thisResult.json_metadata);
|
||||||
|
|
||||||
mobile.cameraExposure(fstop, metadata);
|
mobile.cameraExposure(fstop, metadata);
|
||||||
}
|
}
|
||||||
|
@ -438,8 +438,14 @@ mobile.cameraError = function (err) {
|
||||||
};
|
};
|
||||||
|
|
||||||
mobile.cameraExposure = function (exif) {
|
mobile.cameraExposure = function (exif) {
|
||||||
var fstop = document.querySelector('.fstop').value || 5.6;
|
const fstop = BOLEX.fstop || 5.6;
|
||||||
var iso = document.querySelector('.iso').value || 100;
|
const iso = BOLEX.iso || 100;
|
||||||
|
|
||||||
|
const cFstop = exif.AperatureValue || exif.FNumber;
|
||||||
|
const cExposure = exif.ShutterSpeedValue ? (1 / exif.ShutterSpeedValue) * 1000 : exif.ExposureTime * 1000;
|
||||||
|
const cISO = exif.ISOSpeedRatings[0];
|
||||||
|
|
||||||
|
alert(`${fstop} ${iso} ${cFstop} ${cISO} ${cExposure}`);
|
||||||
/*
|
/*
|
||||||
ApertureValue: 1.6959938131099002
|
ApertureValue: 1.6959938131099002
|
||||||
BrightnessValue: -0.3966568568788107
|
BrightnessValue: -0.3966568568788107
|
||||||
|
@ -469,9 +475,6 @@ mobile.cameraExposure = function (exif) {
|
||||||
SubsecTimeOriginal: "567"
|
SubsecTimeOriginal: "567"
|
||||||
WhiteBalance: 0
|
WhiteBalance: 0
|
||||||
*/
|
*/
|
||||||
exif.AperatureValue || exif.FNumber
|
|
||||||
exif.ExposureTime
|
|
||||||
exif.ISOSpeedRatings
|
|
||||||
};
|
};
|
||||||
mobile.cameraValues = function () {
|
mobile.cameraValues = function () {
|
||||||
document.querySelectorAll('.iso').forEach(input => {
|
document.querySelectorAll('.iso').forEach(input => {
|
||||||
|
|
Loading…
Reference in New Issue