Which corner of the photo? Report coordinates after EXIF rotation

“Look near the top left” works only if both readers see the same top left. A JPEG can store a wide grid of pixels and carry a separate instruction to turn that grid upright. If one viewer follows the instruction and another shows the stored rows, a perfectly good annotation can point at a blank patch.

Sideways and upright prints of a traffic cone, with a frame around the upright cone
Generated illustration of two views. The measured pixel values in the exercise come from a separate synthetic JPEG.

You can resolve the disagreement without changing the original. Name the version you measured, record its dimensions, and describe the point or box in that version’s coordinates. If the recipient needs coordinates for the other view, transform the annotation along with the pixels.

Write down the frame before the numbers

Start with the preserved file. Note its hash, stored width and height, and EXIF Orientation value if available. Then inspect an oriented working copy and record its dimensions separately. A screenshot may have been rotated, scaled, cropped or padded; its screen coordinates are a third frame. A number read from a scaled preview is unusable on the original until you can account for those changes.

The Pillow handbook describes orientation as a display instruction that can include mirroring as well as rotation. For the exercise below, pixel indices start at zero in the upper left. Moving right increases x; moving down increases y. This convention applies to the image even when the surrounding page is written right to left.

A mark that moves from (13, 8) to (39, 13)

We made a synthetic 80 × 48 JPEG with an orange patch and Orientation 6. In the stored grid, pixel (13, 8) falls inside the patch. Applying the orientation once produces a 48 × 80 view. For this tag, the working view turns 90 degrees clockwise; the pixel mapping is (x, y) → (H − 1 − y, x), where H is the original height. Here that gives (48 − 1 − 8, 13) = (39, 13).

We checked the decoded pixel at both positions in a local exercise. They matched. Reading (13, 8) unchanged in the upright copy instead sampled the background. No camera, location or real-world scene was involved. The marked pixel only demonstrates how the two views relate.

from PIL import Image, ImageOps
with Image.open("teaching-photo.jpg") as stored:
    upright = ImageOps.exif_transpose(stored)
    print(stored.size, upright.size)
    print(stored.getpixel((13, 8)) == upright.getpixel((39, 13)))

The ImageOps reference explains that the operation applies the orientation and removes the applied instruction. Use the returned image for the calculation. Do not save it over your source. Do not apply the old tag a second time to an already upright export.

A crop is not a single pixel

Suppose your box covers columns 10 through 17 and rows 5 through 12, inclusive. In the stored grid that is [10,18) × [5,13): include the first edge, exclude the last. In the upright view its columns are 35 through 42 and its rows 10 through 17, or [35,43) × [10,18). Both boxes cover eight columns and eight rows. Treating the excluded right edge as another included pixel would quietly widen the crop.

This formula is for Orientation 6 only. A mirrored tag changes a different axis; a missing tag supplies no rotation to infer. If the two copies also differ by a crop of unknown size, do not guess an offset. Send an annotated working copy, identify a visible landmark, and report coordinates only in the frame you can reproduce.

A note someone else can act on: “Source JPEG preserved; Orientation 6. On the 48 × 80 upright copy, sample pixel (39, 13), measured from the top left. On the stored 80 × 48 grid the same sample is (13, 8).” Use the file-hash guide to identify the source bytes. For a question about the camera or capture time, continue with photo metadata; rotating a coordinate establishes neither.

By OSINT Jet · Primary sources checked 5 November 2026.