Image inspection guides

Choose stored or decoded dimensions for an image upload

·

Use the decoded dimensions when you need the shape a browser displays. For an upload that validates the dimensions in a file header, compare the stored dimensions as well. A photo with an EXIF orientation tag can have a different width and height in each case.

Image Dimensions Checker

Compare three size fields on the same JPEG

Select Load orientation examples. The file dispatch-photo.jpg stores 180 × 240 pixels. Its EXIF orientation value 6 requests a 90-degree clockwise display rotation, so Expected display size is 240 × 180 pixels.

Compare that value with Browser-decoded size. A browser that honors the tag returns 240 × 180 pixels. The PNG card also appears in the report and measures 320 × 180 pixels in all three fields.

Compare three size fields on the same JPEG
FileStored sizeExpected displayBrowser-decoded size
dispatch-photo.jpg180 × 240 px240 × 180 px240 × 180 px
dispatch-card.png320 × 180 px320 × 180 px320 × 180 px

CIPA Exif specification and orientation diagramsHTML Standard for ImageBitmap and image orientationDownload the rotated JPEG exampleDownload the dispatch PNG example

Match the measurement to the upload rule

For a 4:3 landscape component, the example JPEG's display size gives the intended shape. A receiver that explicitly requires at least 240 stored pixels across sees only 180 and can reject the same file.

If the receiver needs a landscape pixel grid, re-export the photo with the orientation applied to its pixels. Inspect the new copy and check that the stored and decoded sizes now agree. Tag values 2 through 4 can change the direction of the content while keeping its width and height.

CIPA Exif specification and orientation diagrams

Read the report when decoding is unavailable

A readable header may supply a valid stored size even when a checksum fails or the image exceeds the decode budget. Browser-decoded size stays unavailable and the other measurements record their own evidence.

Download report and inspect stored, expected and decoder.dimensions for the file. When comparing an animation, check which frame was inspected. The browser check for GIF uses the first frame within the logical screen.

HTML Standard for ImageBitmap and image orientationGIF89a specification and logical screen

Common questions

Why do a rotated photo's aspect ratio and pixel count behave differently?

Swapping width and height changes a portrait ratio of 3:4 into a landscape ratio of 4:3. Both 180 × 240 and 240 × 180 contain 43,200 pixels.

How can I tell whether a size came from the decoder?

Read Browser-decoded size on the file card or decoder.dimensions in the JSON report. Stored size and Expected display size come from the header and readable orientation.

Sources and samples

Put it into practice.

Related guides