-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
140 lines (121 loc) · 5.21 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>The Compliance Warden: Conformance Software for MIAF/HEIF/AVIF/AV1-ISOBMFF/AV1-HDR10+</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#">Compliance Warden</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="https://github.com/gpac/ComplianceWarden">Sources</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/gpac/ComplianceWarden/issues">Issues</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="jumbotron">
<h1 class="display-4">Conformance Software for media files</h1>
<p class="lead">This software checks the conformance of file to the specified standard.
Supported standards are ISOBMFF-based image formats (MIAF, HEIF, AVIF ...) and AV1 bitstreams (AV1-ISOBMFF and AV1-HDR10+ both raw or ISOBMFF).
Beware this is an on-going project and not all features may be supported yet. You can submit <a
href="https://github.com/gpac/ComplianceWarden/issues">issues or pull requests</a> on the <a
href="https://github.com/gpac/ComplianceWarden">source repository</a>.</p>
</p>
<hr class="my-4">
<p>Note that your files are not uploaded in any way. Web Assembly (Wasm) executes the software on your computer.</p>
</div>
<div class="row">
<div class="col">
<form action="javascript:void(0);">
<div class="row">
<div class="col">
<div class="custom-file">
<input type="file" class="custom-file-input" id="files" name="files[]">
<label class="custom-file-label" for="files">Select a file:</label>
</div>
</div>
<div class="col">
<select class="custom-select" id="specs" name="specs">
<option value="avif">AVIF</option>
<option value="miaf">MIAF</option>
<option value="heif">HEIF</option>
<option value="av1hdr10plus">AV1 HDR10+</option>
<option value="av1isobmff">AV1-ISOBMFF</option>
<option value="isobmff">ISOBMFF</option>
</select>
</div>
<div class="col">
<button class="btn btn-primary" id="submit">Submit</button>
</div>
</div>
</div>
</form>
</div>
<br/>
<h3>Result:</h3>
<div id="compliance_report"><code></code></div>
<br/>
<h3>Tool errors:</h3>
<div id="compliance_tool_errors"><code></code></div>
</div>
<script src="ComplianceWarden.js"></script>
<script>
var fileArray = undefined;
var filename = undefined;
let spec = null;
function fileSelection(evt) {
var files = evt.target.files;
if (files[0]) {
filename = files[0].name;
var reader = new FileReader();
reader.onload = (function (file) {
return function (e) {
fileArray = e.target.result;
};
})(filename);
reader.readAsArrayBuffer(files[0]);
}
}
function check_compliance() {
var e = document.getElementById("specs");
var spec_id = e.options[e.selectedIndex].value;
var spec_name = new String(spec_id);
var name = Module._malloc(4 * 4 + 1);
stringToUTF8(spec_name, name, 4 * 4 + 1);
spec = Module._specFindC(name);
Module._free(name);
let comp_mem = Module._malloc(fileArray.byteLength);
Module.HEAPU8.set(new Uint8Array(fileArray), comp_mem);
document.getElementById("compliance_report").innerHTML = "";
document.getElementById("compliance_tool_errors").innerHTML = "";
var file_name = new String(filename);
var fn = Module._malloc(file_name.length * 4 + 1);
stringToUTF8(file_name, fn, file_name.length * 4 + 1);
Module._printVersion();
Module._specCheckC(spec, fn, comp_mem, fileArray.byteLength);
Module._free(fn);
Module._free(comp_mem);
}
document.getElementById('files').addEventListener('change', fileSelection, false);
document.getElementById('submit').addEventListener('click', check_compliance, false);
</script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx"
crossorigin="anonymous"></script>
</body>
</html>