OLD | NEW |
1 // Copyright (c) 2011 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 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
OLD | NEW |