Skip to main content

Image Format

This rule checks that an image has one of the specified formats.

Parameter table

paramunitrequireddescription
formatsyesThe list of the expected formats of the image orderer by preference (e.g., ['jpg', 'png']).

Correction

The correction process attempts to convert the image format to the specified format if the image does not match one of the expected formats.

Note: While the validation process currently supports the detection of various file types to determine if the image is in the correct format,the correction process specifically addresses the following formats: PNG and JPG. Only these formats are corrected to match the target format. If both are specified in the expected file formats list, the first in the list would be applied.

How to setup

This rule enforces a specific image format requirement. The only parameter is:

  • formats: The list of expected formats of the image (e.g., ['jpg', 'png']).

Creator tips

  • You can investigate the image size by simply checking its properties.
  • Verify the format requirement by checking the file extension or format specifications.
  • Ensure the image format matches one of the expected formats.
  • By renaming a file, for example, changing a JPG file to PNG, you are not altering the file's actual format. We detect the MIME type and extension of the file based on the original file, even if you change the file's extension.
  • To convert an image to a different format, you can use online tools or specialized image processing software.

Examples

valuevalidformatsdescription
Diamond(png)The image should be a PNG.
Diamond(jpg)The image should be a JPEG.
JPG Icon(jpg)The image should be a JPEG.
Mario Kart(jpg)The image should be a JPEG.
Mario Kart(jpeg)The image should be a JPEG.
Mario Kart(png, ico)The image should be a PNG or an ICO.