A phone photograph can look upright in a gallery and sideways in another application. Before rotating it or changing the width, check which way the resized file actually appears. Some photographs store a rectangular grid of pixels together with an EXIF orientation instruction that tells a viewer how to display that grid.
This workflow uses the Image Resizer to make a small test copy, then checks the saved file and its final placement. Keep the original photo separately so a mistaken rotation does not become the new master.
Separate the stored pixels from the displayed orientation
The stored width and height alone may not describe the upright view. An orientation instruction can rotate the displayed image through a quarter turn, exchanging its apparent width and height. MDN explains how image orientation can follow EXIF information and how an additional CSS transform applies after that correction.
First identify what upright means for your photograph: a readable sign, a horizon or a person’s head can provide a reference. Open the original in your usual viewer and note that appearance. A portrait-shaped rectangle is not enough to prove that the subject is the right way up.
Create a small copy and inspect the result
- Choose the original JPEG in the resizer. The current displayed input limit is 20 MB. Read Original size after it loads.
- If the photo should be portrait, check whether the loaded height is greater than the width. Use the dimensions reported by this tool for the next calculation rather than copying a different application’s stored-file dimensions.
- Choose Pixel dimensions under Resize by and keep Maintain aspect ratio checked. For a test source reported as 160 by 240, entering width 80 should set height to 120.
- Select PNG (.png) under Output format, then press Resize image. PNG is used for this inspection copy; it is not a recommendation to deliver every photograph as PNG.
- Check the subject in the result preview. If it is upright, press Download result, open the actual PNG and compare the same visual reference.
The resizer draws the loaded image to a canvas and creates a new file. MDN’s canvas export documentation describes that encoding step. Check the saved result itself rather than assuming a conversion message establishes its orientation.
What the paired-file test showed
We checked the current resizer code in a local Chrome browser using two synthetic JPEGs. Both contained the same decoded 240 by 160 pixel grid, with different colors in the four corners. One had EXIF Orientation 6; the other had no orientation tag. They were test patterns, not phone photographs.
| Test file | Size reported on loading | PNG at width 80 |
|---|---|---|
| JPEG with orientation instruction | 160 by 240 | 80 by 120 |
| Same pixels without instruction | 240 by 160 | 80 by 53 |
An independent decoder confirmed the exported dimensions and corner positions. The portrait PNG contained the reoriented picture and no EXIF orientation tag. Loading that PNG into the resizer again kept it at 80 by 120 with the same decoded pixels. In this test, the orientation was already represented in the output pixels; applying another quarter turn would change the correct result.
This establishes the behavior of one browser and one orientation value. It does not guarantee identical handling for every camera file, mirrored orientation or browser. Repeat the visual check with your actual photograph.
Correct the stage where the picture is wrong
If the resizer result is sideways, stop and prepare an upright copy in an image editor. The current resizer has no rotate control. Use an editor operation that applies the intended orientation to the pixels and updates or removes the old orientation instruction. Merely deleting that instruction can leave the stored grid sideways. Pillow documents this distinction in its orientation transpose operation, which applies the indicated change and removes the orientation data.
If the downloaded file is upright but the website turns it sideways, check whether the page or upload workflow adds its own rotation. Avoid rotating the file again to compensate for an unexplained page transform. Upload the checked copy and inspect the final displayed subject.
Once orientation is correct, choose dimensions for the actual placement using the resizing guide. For a lighter photo delivery format, follow the website image compression workflow and recheck orientation after that final export.