Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Side by Side Diff: chrome/browser/resources/file_manager/js/metadata/image_parsers.js

Issue 12207150: [Cleanup] Files.app: Fix wrong style in JavaScript Code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/file_manager/js/metadata/id3_parser.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 /* Base class for image metadata parsers that only need to look at a short 5 /* Base class for image metadata parsers that only need to look at a short
6 fragment at the start of the file */ 6 fragment at the start of the file */
7 function SimpleImageParser(parent, type, urlFilter, headerSize) { 7 function SimpleImageParser(parent, type, urlFilter, headerSize) {
8 ImageParser.call(this, parent, type, urlFilter); 8 ImageParser.call(this, parent, type, urlFilter);
9 this.headerSize = headerSize; 9 this.headerSize = headerSize;
10 } 10 }
11 11
12 SimpleImageParser.prototype = {__proto__: ImageParser.prototype}; 12 SimpleImageParser.prototype = {__proto__: ImageParser.prototype};
13 13
14 SimpleImageParser.prototype.parse = function( 14 SimpleImageParser.prototype.parse = function(
15 file, metadata, callback, errorCallback) { 15 file, metadata, callback, errorCallback) {
16 var self = this; 16 var self = this;
17 util.readFileBytes(file, 0, this.headerSize, 17 util.readFileBytes(file, 0, this.headerSize,
18 function (file, br) { 18 function(file, br) {
19 try { 19 try {
20 self.parseHeader(metadata, br); 20 self.parseHeader(metadata, br);
21 callback(metadata); 21 callback(metadata);
22 } catch(e) { 22 } catch (e) {
23 errorCallback(e.toString()); 23 errorCallback(e.toString());
24 } 24 }
25 }, 25 },
26 errorCallback); 26 errorCallback);
27 }; 27 };
28 28
29 29
30 function PngParser(parent) { 30 function PngParser(parent) {
31 SimpleImageParser.call(this, parent, 'png', /\.png$/i, 24); 31 SimpleImageParser.call(this, parent, 'png', /\.png$/i, 24);
32 } 32 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 br.setByteOrder(ByteReader.LITTLE_ENDIAN); 83 br.setByteOrder(ByteReader.LITTLE_ENDIAN);
84 84
85 var signature = br.readString(6); 85 var signature = br.readString(6);
86 if (!signature.match(/GIF8(7|9)a/)) 86 if (!signature.match(/GIF8(7|9)a/))
87 throw new Error('Invalid GIF signature: ' + signature); 87 throw new Error('Invalid GIF signature: ' + signature);
88 88
89 metadata.width = br.readScalar(2); 89 metadata.width = br.readScalar(2);
90 metadata.height = br.readScalar(2); 90 metadata.height = br.readScalar(2);
91 }; 91 };
92 92
93 MetadataDispatcher.registerParserClass(GifParser); 93 MetadataDispatcher.registerParserClass(GifParser);
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/metadata/id3_parser.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698