-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
67 lines (57 loc) · 2.06 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Make Model Finder</title>
<style type="text/css">
body{
text-align: center;
font-size: 120%;
}
#instructions{
display: none;
margin-top: 24px;
}
#instructions.show{
display: block;
}
</style>
</head>
<body>
<script src="exif-js.js"></script>
How many lines did you count? <input type="number" id="lines" value="20" min="0" max="9999" /><br/>
What's the name of your drone/camera? <input type="text" id="name" value="DJI Mavic Mini v1"/><br/>
Select the image: <input id="fileInput" type="file" accept="image/png, image/jpeg">
<div id="instructions"><b>Excellent!</b> You can open a <a href="https://github.com/OpenDroneMap/ODM/edit/master/opendm/rollingshutter.py">pull request</a> by adding the following line:</div>
<pre id="makeAndModel"></pre>
<script>
var lastFile = null;
var lines = 20;
var name = "DJI Mavic Mini v1";
document.getElementById("fileInput").addEventListener('change', function(e){
lastFile = e.target.files[0];
update();
});
document.getElementById("lines").addEventListener('input', function(e){
var l = parseInt(e.target.value);
if (!isNaN(l)) lines = l;
update();
});
document.getElementById("name").addEventListener('input', function(e){
name = e.target.value;
update();
});
function update(){
if (!lastFile) return;
EXIF.getData(lastFile, function() {
var make = EXIF.getTag(this, "Make");
var model = EXIF.getTag(this, "Model");
var makeAndModel = document.getElementById("makeAndModel");
makeAndModel.innerHTML = "'" + (make + " " + model).toLocaleLowerCase() + "': " + lines + ", # " + name;
document.getElementById("instructions").classList.add("show");
});
}
</script>
</body>
</html>