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

Unified Diff: ui/file_manager/file_manager/foreground/js/thumbnail_loader.js

Issue 2691933007: Rotate an image bitmap in ImageLoader extension when loading detached. (Closed)
Patch Set: update comment. Created 3 years, 10 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
Index: ui/file_manager/file_manager/foreground/js/thumbnail_loader.js
diff --git a/ui/file_manager/file_manager/foreground/js/thumbnail_loader.js b/ui/file_manager/file_manager/foreground/js/thumbnail_loader.js
index 65d012ff2b42fc2a541101782b7be95f58bd8dfc..a2032d530c22d188fc8ddb90efb5c01b3a30416e 100644
--- a/ui/file_manager/file_manager/foreground/js/thumbnail_loader.js
+++ b/ui/file_manager/file_manager/foreground/js/thumbnail_loader.js
@@ -460,16 +460,27 @@ ThumbnailLoader.prototype.loadDetachedImage = function(callback) {
this.metadata_.filesystem &&
this.metadata_.filesystem.modificationTime &&
this.metadata_.filesystem.modificationTime.getTime();
+ var loader_options = {
mtomasz 2017/02/16 08:53:41 nit: camelCase for variable names in JS.
yamaguchi 2017/02/16 14:01:18 Done.
+ maxWidth: ThumbnailLoader.THUMBNAIL_MAX_WIDTH,
+ maxHeight: ThumbnailLoader.THUMBNAIL_MAX_HEIGHT,
+ cache: true,
+ priority: this.priority_,
+ timestamp: modificationTime
+ };
+ if (this.metadata_ && this.metadata_.media &&
+ this.metadata_.media.imageTransform) {
+ loader_options.image_transform = this.metadata_.media.imageTransform;
+ }
+ // Comsume the transform parameter to avoid duplicated transformation in
+ // getImage().
+ // TODO(yamaguchi): remove this line when we move the image transformation
+ // logic out of this class.
+ this.transform_ = undefined;
+
this.taskId_ = ImageLoaderClient.loadToImage(
this.thumbnailUrl_,
this.image_,
- {
- maxWidth: ThumbnailLoader.THUMBNAIL_MAX_WIDTH,
- maxHeight: ThumbnailLoader.THUMBNAIL_MAX_HEIGHT,
- cache: true,
- priority: this.priority_,
- timestamp: modificationTime
- },
+ loader_options,
function() {},
function() {
this.image_.onerror(new Event('load-error'));

Powered by Google App Engine
This is Rietveld 408576698