Images

Check image dimensions and bytes before upload

·

An upload requirement may specify a file type, a width in pixels and a byte limit at the same time. The dispatch examples show how to check each condition and spot a misleading file extension.

Image Size Checker

Check a renamed dispatch image

Select Load dispatch examples. The checker labels dispatch-card.png as PNG. It labels dispatch-photo.png as JPEG even though the example name ends in .png. The second name is set inside the example button so you can repeat the check without renaming a file.

Check the stored and displayed sizes for the JPEG. Its file stores 180 × 240 samples and a clockwise orientation tag. A viewer that follows the tag displays it at 240 × 180, a 4:3 shape. The PNG shows 320 × 180, a 16:9 shape.

Check a renamed dispatch image
RowDetected formatDisplayed dimensionsExact size
dispatch-card.pngPNG320 × 180806 bytes
dispatch-photo.pngJPEG240 × 1805,131 bytes

Download the dispatch card sampleDownload the dispatch JPEG with orientation

Compare megapixels and storage separately

Multiply width by height to get the count of pixels. The card has 57,600 pixels, or 0.0576 megapixels. The JPEG has 43,200 pixels, or 0.0432 megapixels. Sort by Most pixels first to put the card first. Sort by Largest files first to put the JPEG first.

The JPEG occupies more bytes in this example even though it has fewer pixels. For a size limit stated in bytes, compare the exact figures. For a limit stated in KB or KiB, check how the receiving service defines that unit.

W3C PNG specification and image header

Read the result for each container

For a GIF, use the dimensions of its logical screen. An animation can draw individual frames inside that screen. For a multipage TIFF, the checker lists the first page. An ICO can contain multiple sizes and the checker reports the largest variant.

This is a header inspection. If an image meets the width and size requirements yet still fails, open it in a viewer to check the encoded pixel data. An unrecognized row lists the bytes read from the file and an explanation.

GIF89a specification and logical screen descriptor

Common questions

How do I repeat the format check with a downloaded file?

Download the dispatch JPEG and rename it with a .png extension. Select it in the tool. The format still appears as JPEG.

Does checking the image change it?

No. The checker reads the local file's reported byte count and image headers. It leaves the original file unchanged.

Sources and samples

Put it into practice.

Related guides