Module:ImageRatio
Appearance
This module is rated as ready for general use. It has reached a mature form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing. |
Usage
[edit]{{#invoke:ImageRatio|ratio|Filename.jpg}}
This returns the ratio of width to height (w/h) for an image. Defaults to returning 1 if the image doesn't exist, this avoids divide by 0 errors in templates that use it.