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

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: 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..7570c2bb277019381ba0ce0048be87305aef0231 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 {Object} tag EXIF tag object.
Dmitry Zvorygin 2012/07/25 17:41:20 I'd recommend you to use extended notation: @para
+ * @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,13 @@ ExifEncoder.writeValue = function(bw, tag) {
}
};
-//TODO(JSDOC)
+/**
+ * @param {Object} directory EXIF directory.
Dmitry Zvorygin 2012/07/25 17:41:20 {Object.<number, Object>}
+ * @param {number} id Tag id.
+ * @param {number} format Tag format (used in getComponentWidth).
Dmitry Zvorygin 2012/07/25 17:41:20 ... format used in {@link ExifEncoder#getComponent
+ * @param {number} componentCount Number of components in this tag.
+ * @return {Object} Tag found or created.
Dmitry Zvorygin 2012/07/25 17:41:20 @return {{id:number, format:number, componentCount
+ */
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