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

Unified Diff: chrome/browser/resources/file_manager/js/image_editor/exif_encoder.js

Issue 10833007: [Photo Editor] Make exif encoder more tolerant to non-standard EXIF data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/image_editor/exif_encoder.js
diff --git a/chrome/browser/resources/file_manager/js/image_editor/exif_encoder.js b/chrome/browser/resources/file_manager/js/image_editor/exif_encoder.js
index 2a056db802fe93bc47d233698bb07382be3a6499..4b330f4d2afb33e27e722372a65ff3389f9a40af 100644
--- a/chrome/browser/resources/file_manager/js/image_editor/exif_encoder.js
+++ b/chrome/browser/resources/file_manager/js/image_editor/exif_encoder.js
@@ -321,8 +321,11 @@ ExifEncoder.encodeDirectory = function(
}
};
-// TODO(kaznacheev): Share with ExifParser?
-// TODO(JSDOC)
+/**
+ * @param {{format:number, id:number}} tag EXIF tag object.
+ * @return {number} Width in bytes of the data unit associated with this tag.
+ * TODO(kaznacheev): Share with ExifParser?
+ */
ExifEncoder.getComponentWidth = function(tag) {
switch (tag.format) {
case 1: // Byte
@@ -342,7 +345,7 @@ ExifEncoder.getComponentWidth = function(tag) {
return 8;
default: // ???
- throw new Error('Unknown tag format 0x' +
+ console.warn('Unknown tag format 0x' +
Number(tag.id).toString(16) + ': ' + tag.format);
return 4;
}
@@ -383,7 +386,15 @@ ExifEncoder.writeValue = function(bw, tag) {
}
};
-//TODO(JSDOC)
+/**
+ * @param {{Object.<number,Object>}} directory EXIF directory.
+ * @param {number} id Tag id.
+ * @param {number} format Tag format
+ * (used in {@link ExifEncoder#getComponentWidth}).
+ * @param {number} componentCount Number of components in this tag.
+ * @return {{id:number, format:number, componentCount:number}}
+ * Tag found or created.
+ */
ExifEncoder.findOrCreateTag = function(directory, id, format, componentCount) {
if (!(id in directory)) {
directory[id] = {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698