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

Unified Diff: ui/file_manager/gallery/js/image_editor/image_view.js

Issue 310433004: Gallery.app: Update thumbnail when a file is edited on the photo editor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 7 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 | « ui/file_manager/gallery/js/image_editor/image_util.js ('k') | ui/file_manager/gallery/js/ribbon.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/image_editor/image_view.js
diff --git a/ui/file_manager/gallery/js/image_editor/image_view.js b/ui/file_manager/gallery/js/image_editor/image_view.js
index fe289a0d6bc5d67ed1e69fd18b28c2e71fe3454a..c5c1af59f761d1da69fc22c720f3bed7ca9fc22c 100644
--- a/ui/file_manager/gallery/js/image_editor/image_view.js
+++ b/ui/file_manager/gallery/js/image_editor/image_view.js
@@ -403,13 +403,24 @@ ImageView.prototype.load = function(entry, metadata, effect,
function displayThumbnail(loadType, canvas) {
if (canvas) {
+ var width = null;
+ var height = null;
+ if (metadata.media) {
+ width = metadata.media.width;
+ height = metadata.media.height;
+ }
+ // If metadata.drive.present is true, the image data is loaded directly
+ // from local cache, whose size may be out of sync with the drive
+ // metadata.
+ if (metadata.drive && !metadata.drive.present) {
+ width = metadata.drive.imageWidth;
+ height = metadata.drive.imageHeight;
+ }
self.replace(
canvas,
effect,
- (metadata.media && metadata.media.width) ||
- metadata.drive.imageWidth,
- (metadata.media && metadata.media.height) ||
- metadata.drive.imageHeight,
+ width,
+ height,
true /* preview */);
if (displayCallback) displayCallback();
}
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/image_util.js ('k') | ui/file_manager/gallery/js/ribbon.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698