OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var exif = { | 5 var exif = { |
6 verbose: false, | 6 verbose: false, |
7 | 7 |
8 messageHandlers: { | 8 messageHandlers: { |
9 "init": function() { | 9 "init": function() { |
10 this.log('thumbnailer initialized'); | 10 this.log('thumbnailer initialized'); |
(...skipping 20 matching lines...) Expand all Loading... |
31 self.vlog('Error processing: ' + fileURL + ': step: ' + | 31 self.vlog('Error processing: ' + fileURL + ': step: ' + |
32 steps[currentStep].name + ": " + err); | 32 steps[currentStep].name + ": " + err); |
33 | 33 |
34 postMessage({verb: 'give-exif-error', | 34 postMessage({verb: 'give-exif-error', |
35 arguments: [fileURL, steps[currentStep].name, err]}); | 35 arguments: [fileURL, steps[currentStep].name, err]}); |
36 } | 36 } |
37 | 37 |
38 var steps = | 38 var steps = |
39 [ // Step one, turn the url into an entry. | 39 [ // Step one, turn the url into an entry. |
40 function getEntry() { | 40 function getEntry() { |
41 resolveLocalFileSystemURL(fileURL, | 41 webkitResolveLocalFileSystemURL(fileURL, |
42 function(entry) { nextStep(entry) }, | 42 function(entry) { nextStep(entry) }, |
43 onError); | 43 onError); |
44 }, | 44 }, |
45 | 45 |
46 // Step two, turn the entry into a file. | 46 // Step two, turn the entry into a file. |
47 function getFile(entry) { | 47 function getFile(entry) { |
48 entry.file(function(file) { nextStep(file) }, onError); | 48 entry.file(function(file) { nextStep(file) }, onError); |
49 }, | 49 }, |
50 | 50 |
51 // Step three, read the file header into a byte array. | 51 // Step three, read the file header into a byte array. |
52 function readHeader(file) { | 52 function readHeader(file) { |
53 var reader = new FileReader(file.webkitSlice(0, 1024)); | 53 var reader = new FileReader(file.webkitSlice(0, 1024)); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 skip: function(count) { | 329 skip: function(count) { |
330 this.pos_ += count; | 330 this.pos_ += count; |
331 }, | 331 }, |
332 | 332 |
333 tell: function() { | 333 tell: function() { |
334 return this.pos_; | 334 return this.pos_; |
335 } | 335 } |
336 }; | 336 }; |
337 | 337 |
338 var onmessage = exif.onMessage.bind(exif); | 338 var onmessage = exif.onMessage.bind(exif); |
OLD | NEW |