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

Unified Diff: ui/file_manager/gallery/js/mosaic_mode.js

Issue 971173002: Gallery: Start to use new metadata model in Gallery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 5 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
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/image_view.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/mosaic_mode.js
diff --git a/ui/file_manager/gallery/js/mosaic_mode.js b/ui/file_manager/gallery/js/mosaic_mode.js
index 1b419b6cc6c80cce049d9cf1f137c08c51a8a32b..264dc0ce292a8271213b24fb0cce32a8064b1788 100644
--- a/ui/file_manager/gallery/js/mosaic_mode.js
+++ b/ui/file_manager/gallery/js/mosaic_mode.js
@@ -2095,15 +2095,12 @@ Mosaic.Tile.prototype.init = function() {
// extracted from headers. For Drive files, it is received via the Drive API.
// If the dimensions are not available, then the fallback dimensions will be
// used (same as for the generic icon).
+ var metadataItem = this.getItem().getMetadataItem();
var width;
var height;
- if (metadata.media && metadata.media.width) {
- width = metadata.media.width;
- height = metadata.media.height;
- } else if (metadata.external && metadata.external.imageWidth &&
- metadata.external.imageHeight) {
- width = metadata.external.imageWidth;
- height = metadata.external.imageHeight;
+ if (metadataItem.imageWidth && metadataItem.imageHeight) {
+ width = metadataItem.imageWidth;
+ height = metadataItem.imageHeight;
} else {
// No dimensions in metadata, then use the generic dimensions.
width = Mosaic.Tile.GENERIC_ICON_SIZE;
« no previous file with comments | « ui/file_manager/gallery/js/image_editor/image_view.js ('k') | ui/file_manager/gallery/js/ribbon.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698