1

How can one change the aspect ratio of a Wikipedia image?

For example, in the International Code of Signals, an example of the 'Whiskey' flag (referring to the letter W) is saved with an aspect ratio of 3:2 :

[[File:Whiskey flag.svg]]

It is also legitimate to display these flags with an aspect ratio of 1:1, and I'm trying to figure out how to do so with the existing material.

Based on the information at https://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax, I've experimented with the following:

  • [[File:Whiskey flag.svg|50x50px]]
  • [[File:Whiskey flag.svg|50px|x50px]]
  • [[File:Whiskey flag.svg|50px|upright=1.33]]
  • [[File:Whiskey flag.svg|50px|upright=0.66]]

but all of these have been unsuccessful.

Is it possible to change the aspect ratio of an image in Wikipedia and, if so, how?

2 Answers 2

2

As far as I know, MediaWiki doesn't have any syntax for that. The image syntax is for displaying images, not for modifying them, which is what you're asking.

To do this, I think you will have to reupload the image with the aspect ratio you want.

2

Svick is correct; there is no way in MediaWiki to change an image's aspect ratio without reuploading it.

However, the first bullet point, [[File:Whiskey flag.svg|50x50px]], is actually correct, but it just doesn't do what you may expect it to. That syntax sets whichever dimension is larger, height or width, to 50px and computes the other based on the aspect ratio.

For example, [[File:Flag of Bhutan.svg|100x100px]] displays the image with a width of 100px and a height of 67px because it is longer than it is tall. [[File:Flag of Nepal.svg|100x100px]] displays with a width of 82px and a height of 100px because it is taller than it is wide.

Flag of Bhutan Flag of Nepal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.