jenkins-bot has submitted this change and it was merged. Change subject: Make sure originalDimensions are available before use ......................................................................
Make sure originalDimensions are available before use Before applying default size based on originalDimensions, make sure these are available through the scalable call. The image will be marked as default size, but the presentation will depend on whether or not we have the defaultDimensions from the API. Bug: 65239 Change-Id: I41b30498713e969bd24ef0ad3e9a074c6ffcdc3b --- M modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js 1 file changed, 8 insertions(+), 3 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js index 769deb8..bdedb88 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js @@ -621,10 +621,15 @@ // Figure out the default size if ( imageType === 'thumb' || imageType === 'frame' ) { // Default is thumb-default unless the image is originally smaller - if ( originalDimensions.width > this.defaultThumbSize ) { - attr = this.scalable.getDimensionsFromValue( { 'width': this.defaultThumbSize } ); - } else { + if ( + originalDimensions && + originalDimensions.width < this.defaultThumbSize + ) { attr = originalDimensions; + } else { + attr = this.scalable.getDimensionsFromValue( { + 'width': this.defaultThumbSize + } ); } } else { // Default is full size -- To view, visit https://gerrit.wikimedia.org/r/133123 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I41b30498713e969bd24ef0ad3e9a074c6ffcdc3b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Mooeypoo <mor...@gmail.com> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits