Check image dimensions and bytes before upload
Admin ·
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.
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.
| Row | Detected format | Displayed dimensions | Exact size |
|---|---|---|---|
| dispatch-card.png | PNG | 320 × 180 | 806 bytes |
| dispatch-photo.png | JPEG | 240 × 180 | 5,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.
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.
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
- Read EXIF coordinates and camera tags
- How to Compress an Image: Quality and Size
- How to Resize an Image by Pixels or Percentage
- Change Image DPI Without Resampling
- Identify an Image With a Misleading Extension
- Fit an Image Under 1 MB and Check Its Bytes
- Make Editable SVG Shapes From a PNG
- Convert One ICO Entry to SVG
- Account for Every Byte in an Image File
- Check Stored and Display Image Size