jenkins-bot has submitted this change and it was merged.
Change subject: Do not apply unnecessary file dimensions constraints
......................................................................
Do not apply unnecessary file dimensions constraints
I'm not sure what's the exact goal of code that I had to modify, but
after my modification it definitely solves the problem and doesn't break
the test.
Problem was occurring when for instance parsing this wikitext:
[[Image:ASCII Code Chart-Quick ref card.jpg|thumb|361px]] height
constraint of 180px was applied - and because image have to stay
proportional it's width was limited as well.
Change-Id: I2d56c9f1ed164ffcdefd0de94d95f03f744fea41
---
M js/lib/ext.core.LinkHandler.js
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Subramanya Sastry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/js/lib/ext.core.LinkHandler.js b/js/lib/ext.core.LinkHandler.js
index dccc52a..ff83dda 100644
--- a/js/lib/ext.core.LinkHandler.js
+++ b/js/lib/ext.core.LinkHandler.js
@@ -1168,8 +1168,10 @@
}
if ( oHash.format && oHash.format !== 'framed' ) {
- constraints.height = constraints.height || 180;
- constraints.width = constraints.width || 180;
+ if ( !constraints.height && !constraints.width ) {
+ constraints.height = 180;
+ constraints.width = 180;
+ }
}
var infoRequest = new ImageInfoRequest( env, filename, constraints );
--
To view, visit https://gerrit.wikimedia.org/r/70308
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2d56c9f1ed164ffcdefd0de94d95f03f744fea41
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Inez <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits