Last modified: 2012-12-31 14:16:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32282, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30282 - Return aspect ratio of an image
Return aspect ratio of an image
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Low enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-09 05:03 UTC by taylornate
Modified: 2012-12-31 14:16 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description taylornate 2011-08-09 05:03:55 UTC
It is common to use the multiple image template (http://en.wikipedia.org/wiki/Template:Multiple_image) to post post a row of thumbnails specified to be the same height.  The template needs to know the width of each thumbnail in order to draw a box around them.  It has no way to obtain the dimensions or aspect ratio of the original images.  Therefore the template does not accept height as a parameter.  In order to obtain the desired result, one must manually enter the dimensions of each image and desired height into a formula that returns the width.

Example:
Instead of entering simply this:
height = 100

One must enter this:
width1 = {{#expr: (100 * 750 / 536) round 0}}
width2 = {{#expr: (100 * 320 / 438) round 0}}
width3 = {{#expr: (100 * 892 / 723) round 0}}
etc.

This is hackish and cumbersome and can mess up formatting if an image is updated with a different aspect ratio.  If there was a way to obtain the dimensions or aspect ratio of an image then the template could handle this.
Comment 1 Brion Vibber 2011-08-15 18:39:21 UTC
This template seems to be trying to reproduce the <gallery> tag hook.

Does it have specific features that are useful etc, or should it simply be replaced with use of <gallery>?

What exactly does it need to know image width/height for to draw boxes? Shouldn't it leave boxes to the style sheets or MediaWiki's own image box rendering?
Comment 2 Bawolff (Brian Wolff) 2011-08-15 18:41:44 UTC
As an aside, there are several extensions that do this - [[mw:Extension:MediaFunctions]], among others.
Comment 3 taylornate 2011-09-09 20:32:56 UTC
Brion Vibber:  This template formats the images in a much more aesthetically pleasing and efficient way.

Bawolff:  This looks like just what I'm looking for.  How might I ask for this to be included in a main release of MediaWiki or installed on Wikimedia so it can be used in the multiple image template on Wikipedia?
Comment 4 Bawolff (Brian Wolff) 2011-09-09 21:43:53 UTC
> Bawolff:  This looks like just what I'm looking for.  How might I ask for this
> to be included in a main release of MediaWiki or installed on Wikimedia so it
> can be used in the multiple image template on Wikipedia?

Generally you need to get community consensus and then convince a senior dev to review it (generally takes a long time, especially if the use-cases for it aren't particularly strong. There's a long list of extensions waiting review at [[mw:Review_queue#Extensions]] )

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links