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

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: Fix test failure in FileManagerJsTest.ThumbnailLoader. 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..49898f024f14a3bccbb01c9a19ad50fb61bb9177 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 loaderOptions = {
+ 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) {
+ loaderOptions.orientation = 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
- },
+ loaderOptions,
function() {},
function() {
this.image_.onerror(new Event('load-error'));

Powered by Google App Engine
This is Rietveld 408576698