From b007aaa741b48cc4d2e7ec463380f64cc20d5003 Mon Sep 17 00:00:00 2001 From: seddon Date: Tue, 24 Aug 2021 15:06:44 +0100 Subject: [PATCH] Err: param required cant be empty/0 ThumbnailWidth Bug: T277893 Change-Id: I5b440be10aa30527270515f6921596b8000a9f83 --- resources/mmv/mmv.ThumbnailWidthCalculator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/mmv/mmv.ThumbnailWidthCalculator.js b/resources/mmv/mmv.ThumbnailWidthCalculator.js index f80eb24f9..039d308d8 100644 --- a/resources/mmv/mmv.ThumbnailWidthCalculator.js +++ b/resources/mmv/mmv.ThumbnailWidthCalculator.js @@ -162,9 +162,9 @@ ratio = sampleHeight / sampleWidth; cssWidth = this.calculateFittingWidth( boundingWidth, boundingHeight, sampleWidth, sampleHeight ); - cssHeight = Math.round( cssWidth * ratio ); + cssHeight = Math.max( 1, Math.round( cssWidth * ratio ) ); - screenPixelWidth = cssWidth * this.devicePixelRatio; + screenPixelWidth = Math.max( 1, cssWidth * this.devicePixelRatio ); bucketedWidth = this.findNextBucket( screenPixelWidth );