Permalink
Browse files

jpeg.html: clean up

  • Loading branch information...
1 parent 4086e36 commit 5e0808eb4546eaf201d867ffad09f8b80955c269 @kig committed Jun 21, 2012
Showing with 0 additions and 33 deletions.
  1. +0 −33 jpeg.html
View
@@ -1,6 +1,5 @@
<html>
<head>
- <script src="structdef.js"></script>
<script src="DataStream.js"></script>
</head>
<body>
@@ -12,34 +11,6 @@
document.querySelector('input[type="file"]').onchange = function(e) {
var reader = new FileReader();
-/* Old structdef.js JPEG parser, compared to DataStream, guards are nice. */
-/*
- var jpegMarkerDef = [
- { tag: 'uint16=0xFFE1', // EXIF
- length: 'uint16',
- exif: 'string:6=Exif\000\000',
- data: ['uint8', 'length-8']
- },
- {
- tag: 'uint16!=0xFFDA',
- length: 'uint16',
- data: ['uint8', 'length-2']
- }
- ];
-
- var jpegImageStream = {
- tag: 'uint16=0xFFDA',
- data: ['uint8', -2]
- };
-
- var jpegDef = {
- start: 'uint16=0xFFD8',
- markers: [jpegMarkerDef, '*'],
- image: jpegImageStream,
- end: 'uint16=0xFFD9'
- };
-*/
-
var tiffByteSize = {
1:1, 2:1, 3:2, 4:4, 5:8, 6:1, 7:1, 8:2, 9:4, 10:8, 11:4, 12:8
};
@@ -280,11 +251,7 @@
var ds = new DataStream(this.result);
ds.endianness = DataStream.BIG_ENDIAN;
var obj = ds.readStruct(jpegStruct) || parseTIFF(this.result);
-// var dv = new DataView(this.result);
-
-// var idx = [0];
pre = document.querySelector('pre');
-// var obj = readStruct(dv, idx, jpegDef);
if (obj) {
pre.textContent = JSON.stringify(obj, null, 4);
} else {

0 comments on commit 5e0808e

Please sign in to comment.