Game asset processing4 min read

An Uploaded Image Rotates Twice? Separate EXIF Orientation from Pixel Rotation

A viewer may apply orientation metadata without changing encoded pixels. Trace decoding and manual transforms before rotating the same image again.

An Uploaded Image Rotates Twice? Separate EXIF Orientation from Pixel Rotation
Concept art of potion cards and a pixel grid
AI-generated pixel concept art, not an EXIF or rotation-repair test.

An image looks upright in a viewer but sideways after import or export. Rotating it manually makes another preview wrong again. First distinguish pixels already transformed from a viewer displaying the file according to an orientation tag.

Pixel arrangement and display orientation are separate

Encoded pixels and EXIF orientation metadata serve different roles. A decoder can adjust orientation using metadata while another path uses different options. Record the input and decode path instead of relying only on two preview screenshots.

The MDN createImageBitmap reference documents imageOrientation: the default from-image uses EXIF orientation when present; none follows the encoding while ignoring orientation metadata; flipY applies orientation and then a vertical flip. Confirm support in the actual browser and library rather than assuming every loading API behaves identically.

Locate the step that changes the pixels

  1. Retain the untouched input and record encoded dimensions, an available orientation tag and the viewer.
  2. Establish whether decoding already used the tag, then inspect additional rotation or flipping.
  3. Inspect actual output pixels and retained orientation metadata, not only the on-screen preview.
  4. Verify the same output in a second path with explicit decoding behavior.

For example, a 1200×800 encoded image displayed after a 90-degree turn can have an 800×1200 display orientation. That geometric example does not establish that file bytes were rearranged or that every interface reports dimensions from the same processing stage.

Do not correct pixels while leaving a contradictory tag

If delivery requires normalized orientation, the pipeline should explicitly define whether orientation is baked into pixels and how output metadata is handled. Applying a manual turn after EXIF correction can transform the image twice; deleting the tag before correction can instead change later display.

This is separate from rotation during Spine Atlas packing, which is interpreted through Atlas metadata. Changing a DPI label is not a pixel-orientation repair either.

Accept the delivery file independently

The Resource Compression tool's normal file workflow can prepare a comparison copy for checking dimensions, orientation and appearance. This does not assert a particular internal decoder or promise an EXIF settings control.

No browser or user-image orientation experiment was performed for this article. Retain input, processing settings and final file in the acceptance record. The artwork is a pixel concept, not a camera photo or before-and-after orientation test.

Ready to try "An Uploaded Image Rotates Twice? Separate EXIF Orientation from Pixel Rotation"?

Use our online tools to apply this tutorial to your indie game project right away.