Requests for comment/Square bounding boxes

The current mediawiki syntax for image thumbnails and resizing works poorly for images which are taller than they are wide. The  option attempts to remedy this, but properly scaling an thumbnail to fit a square bounding box requires the user to manually compute the aspect ratio of the image. There is no way to directly limit or scale a thumbnail based on height.

Proposals
There are two proposals for remedying this situation:
 * 1) Change mediawiki to use square bounding boxes by default (opt-out).
 * 2) Add a new image option to request a square bounding box (opt-in).

Square bounding boxes by default
In this version of the proposal, the existing width-only restrictions on image size would be the exception, not the rule. Assuming a 220px default thumbnail size: 200px             (scales to 200 x 200 bounding box) thumb             (scales to 220 x 220 bounding box) thumb|upright=0.5 (scales to 110 x 110 bounding box) x200px            legacy syntax, restricts height only 150x200px         legacy syntax, uses specified non-square bounding box 200xpx            new syntax, restricts width only? no way to have a thumbnail scaled by default width only

New "square" option
In this version of the proposal, a new "square" image option opts-in to square bounding boxes. Again assuming a 220px default thumbnail size: (resizes to 200x200px) (resizes to 200x200px) (resizes to 200x200px, using max dimension) (resizes to 220x220px) (resizes to 110x110px)

Discussion
Another hacky way to get a square bounding box for a thumbnail with current wikitext is: thumb|upright=XXX where the  is the computed current aspect ratio of. This will give unintended results if a new version of  is uploaded with a different aspect ratio. However, this is what Parsoid will likely implement as the default serialization in the short term. —The preceding unsigned comment was added by Cscott (talk • contribs) 16:11, 27 March 2014 (UTC)

Option 1 would be a torches-and-pitchforks change, as it breaks changes in an incompatible and likely unappealing manner any existing usages of "portrait"-oriented images. -2 from me on this. Anomie (talk) 17:09, 27 March 2014 (UTC)

As for option 2, we already have a syntax for specifying a square bounding box with explicit pixel dimensions, that being "200x200px". So just like 'upright', IMO this should only have an effect if pixel dimensions are not given. "|upright=0.5|square" probably also deserves more thought, as I doubt that the user really intends to bound it to 110x110px rather than something like 110x220px. Anomie (talk) 17:09, 27 March 2014 (UTC)

Implementation
The "square" image option is implemented by https://gerrit.wikimedia.org/r/120856