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

Side by Side Diff: ui/file_manager/gallery/js/image_editor/image_encoder.js

Issue 1408533002: Turn on verbose flag for compiling file_manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use type cast for createElement, fix indent. Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 /** 5 /**
6 * A namespace class for image encoding functions. All methods are static. 6 * A namespace class for image encoding functions. All methods are static.
7 */ 7 */
8 function ImageEncoder() {} 8 function ImageEncoder() {}
9 9
10 /** 10 /**
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 /** 212 /**
213 * Gets mime type from metadata. It reads media.mimeType at first, and if it 213 * Gets mime type from metadata. It reads media.mimeType at first, and if it
214 * fails, it falls back to external.contentMimeType. If both fields are 214 * fails, it falls back to external.contentMimeType. If both fields are
215 * undefined, it means that metadata is broken. Then it throws an exception. 215 * undefined, it means that metadata is broken. Then it throws an exception.
216 * 216 *
217 * @param {!MetadataItem} metadata Metadata. 217 * @param {!MetadataItem} metadata Metadata.
218 * @return {string} Mime type. 218 * @return {string} Mime type.
219 * @private 219 * @private
220 */ 220 */
221 ImageEncoder.MetadataEncoder.getMimeType_ = function(metadata) { 221 ImageEncoder.MetadataEncoder.getMimeType_ = function(metadata) {
222 if (metadata.mediaMimeType) 222 return assert(metadata.mediaMimeType || metadata.contentMimeType);
223 return metadata.mediaMimeType;
224 else if (metadata.contentMimeType)
225 return metadata.contentMimeType;
226
227 assertNotReached();
228 }; 223 };
229 224
230 /** 225 /**
231 * Sets an image data. 226 * Sets an image data.
232 * @param {!HTMLCanvasElement} canvas Canvas or anything with width and height 227 * @param {!HTMLCanvasElement} canvas Canvas or anything with width and height
233 * properties. 228 * properties.
234 */ 229 */
235 ImageEncoder.MetadataEncoder.prototype.setImageData = function(canvas) { 230 ImageEncoder.MetadataEncoder.prototype.setImageData = function(canvas) {
236 this.imageWidth = canvas.width; 231 this.imageWidth = canvas.width;
237 this.imageHeight = canvas.height; 232 this.imageHeight = canvas.height;
(...skipping 19 matching lines...) Expand all
257 findInsertionRange = function(encodedImage) { return {from: 0, to: 0}; }; 252 findInsertionRange = function(encodedImage) { return {from: 0, to: 0}; };
258 253
259 /** 254 /**
260 * Returns serialized metadata ready to write to an image file. 255 * Returns serialized metadata ready to write to an image file.
261 * The return type is optimized for passing to Blob.append. 256 * The return type is optimized for passing to Blob.append.
262 * @return {!ArrayBuffer} Serialized metadata. 257 * @return {!ArrayBuffer} Serialized metadata.
263 */ 258 */
264 ImageEncoder.MetadataEncoder.prototype.encode = function() { 259 ImageEncoder.MetadataEncoder.prototype.encode = function() {
265 return new Uint8Array(0).buffer; 260 return new Uint8Array(0).buffer;
266 }; 261 };
OLDNEW
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/image_editor.js ('k') | ui/file_manager/gallery/js/image_editor/image_transform.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698