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

Unified Diff: chrome/browser/resources/file_manager/js/exif_parser.js

Issue 8394046: [filebrowser] More reliable file saving in Photo Editor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/id3_parser.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/exif_parser.js
diff --git a/chrome/browser/resources/file_manager/js/exif_parser.js b/chrome/browser/resources/file_manager/js/exif_parser.js
index 036a2375a7670e149c184f0a55da4a4f370eb1a9..bc1e69e96e9ec49c2d2486126d3ff0705873ff9b 100644
--- a/chrome/browser/resources/file_manager/js/exif_parser.js
+++ b/chrome/browser/resources/file_manager/js/exif_parser.js
@@ -23,16 +23,10 @@ const EXIF_TAG_X_DIMENSION = 0xA002;
const EXIF_TAG_Y_DIMENSION = 0xA003;
function ExifParser(parent) {
- MetadataParser.apply(this, [parent]);
- this.verbose = false;
- this.mimeType = 'image/jpeg';
+ ImageParser.call(this, parent, 'jpeg', /\.jpe?g$/i);
}
-ExifParser.parserType = 'exif';
-
-ExifParser.prototype = {__proto__: MetadataParser.prototype};
-
-ExifParser.prototype.urlFilter = /\.jpe?g$/i;
+ExifParser.prototype = {__proto__: ImageParser.prototype};
ExifParser.prototype.parse = function(file, callback, errorCallback) {
var self = this;
@@ -82,7 +76,7 @@ ExifParser.prototype.parse = function(file, callback, errorCallback) {
// with no EXIF data. Still might want to handle this more carefully.
if (br.tell() + 7 < buf.byteLength) {
br.seek(3, ByteReader.SEEK_CUR);
- var metadata = {mimeType: self.mimeType};
+ var metadata = self.createDefaultMetadata();
metadata.width = br.readScalar(2);
metadata.height = br.readScalar(2);
callback(metadata);
@@ -125,14 +119,11 @@ ExifParser.prototype.parse = function(file, callback, errorCallback) {
if (tag != EXIF_TAG_TIFF)
return onError('Invalid TIFF tag: ' + tag.toString(16));
- var metadata = {
- metadataType: ExifParser.parserType,
- mimeType: self.mimeType,
- littleEndian: (order == EXIF_ALIGN_LITTLE),
- ifd: {
- image: {},
- thumbnail: {}
- }
+ var metadata = self.createDefaultMetadata();
+ metadata.littleEndian = (order == EXIF_ALIGN_LITTLE);
+ metadata.ifd = {
+ image: {},
+ thumbnail: {}
};
var directoryOffset = br.readScalar(4);
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/id3_parser.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698