Skip to main content

Size Range

This rule checks that an image has both a width and a height within the specified range (in pixels).

Parameter table

paramunitrequireddescription
minWidthpxnoThe minimum width of the image in pixels (minWidth).
maxWidthpxnoThe maximum width of the image in pixels (maxWidth).
minHeightpxnoThe minimum height of the image in pixels (minHeight).
maxHeightpxnoThe maximum height of the image in pixels (maxHeight).

Correction

The correction process proposes a maximum of two alternatives:

  1. First Proposal (Maintaining Original Ratio):
  • If feasible, the first proposal aims to retain the same aspect ratio as the original image while fitting within the specified dimensions.
  • In some cases, maintaining the original ratio may not be possible while adhering to the given constraints.
  1. Second Proposal (Non-Original Ratio):
  • The second proposal does not necessarily maintain the original aspect ratio.
  • Priority for each dimension (width or height) is determined in the following order:
  • The original dimension (if within the specified interval).
  • The minimum dimension (minWidth, minHeight) if provided.
  • The maximum dimension (maxWidth, maxHeight).

The correction process ensures that at most two proposals are generated, considering the specified constraints.

How to setup

This rule evaluates whether an image's dimensions adhere to specified size constraints. Key parameters include:

  • minWidth: Minimum width of the image in pixels.
  • maxWidth: Maximum width of the image in pixels.
  • minHeight: Minimum height of the image in pixels.
  • maxHeight: Maximum height of the image in pixels.

All arguments are optional, but at least one is expected.

Creator tips

  • You can investigate the image size by simply checking its properties.
  • You can resize images with simple image editing tools like paint.

Examples

valuevalidmaxHeightmaxWidthminHeightminWidthdescription
Diamond5125123232The image size should be [32, 512]x[32, 512].
Minecraft Player64The image maximum height should be 64px.