Skip to content
Back to Blog
platform-pain-points

Image Rotated Wrong After Upload? EXIF Orientation Fix

2026-05-17 8 min read

Why Your Photo Looks Sideways (And It's Not Your Fault)

You take a portrait shot on your iPhone, upload it to a website or convert it to another format, and suddenly the image is rotated 90 degrees sideways. The photo looks fine in your camera roll. It looks fine in Preview or Windows Photos. But the moment it hits a web form, a conversion tool, or an email client, it's lying on its side like a toppled filing cabinet. This is one of the most frustrating and misunderstood problems in digital photography, and it happens to millions of people every week. The root cause is something called EXIF orientation metadata. When your phone or digital camera captures a photo, it writes a small tag into the image file — specifically EXIF tag 0x0112 — that records which direction the device was physically held. The sensor itself almost always captures the image in landscape orientation (that's just how camera sensors are laid out). Instead of rotating the actual pixel data, the camera simply writes a note: 'Hey, this image should be displayed rotated 90 degrees clockwise.' Most modern apps read that note and display the image correctly. But plenty of software — older browsers, certain conversion pipelines, some CMSes, and even a few image editors — ignores the tag entirely and renders the raw pixel data as-is. The result: your portrait photo appears sideways or even upside down. The eight possible EXIF orientation values (1 through 8) cover every combination of rotation and mirroring. Value 1 means 'display as-is.' Value 6 means 'rotate 90 degrees clockwise before displaying.' Value 3 means 'rotate 180 degrees.' If software doesn't honor those values, you get the raw sensor output, which can be rotated anywhere from 90 to 270 degrees off from what you intended.

The Three Ways This Problem Appears After a File Conversion

EXIF orientation issues tend to surface in three distinct scenarios after you run an image through a conversion tool, and knowing which one you're dealing with changes how you fix it. **Scenario 1: The EXIF tag gets stripped entirely.** Some conversion processes — especially those that convert to formats like PNG or BMP that have no native EXIF support — strip all metadata from the output file. The pixel data is still in the original sensor orientation (say, landscape), but now there's no orientation tag telling software to rotate it. If your source was a portrait JPEG shot with EXIF tag 6, you'll end up with a PNG that is permanently sideways, with no metadata left to salvage. **Scenario 2: The EXIF tag is preserved but ignored.** The converted file still has the orientation tag, but the destination platform (a website, a document, a social media uploader) doesn't read EXIF data. This is extremely common with older web applications and any platform that processes images server-side without an EXIF-aware library. The tag is there; it's just being ignored. **Scenario 3: The conversion tool rotates the pixels AND keeps the old tag.** This is the sneaky one. A conversion tool tries to be helpful by physically rotating the pixel data to match the EXIF tag, but then forgets to update or remove the tag. Now your image has correct pixel orientation AND a tag that says 'rotate me again.' The result is a double-rotation — a portrait image that ends up upside down or rotated 180 degrees from where it should be. Before you apply any fix, open the converted file in a hex editor or a metadata viewer (ExifTool is free and reliable) and check what tag 0x0112 actually says. That 30-second check will tell you exactly which scenario you're in and prevent you from making the problem worse.

How CocoConvert Handles EXIF Orientation

CocoConvert's conversion engine reads the EXIF orientation tag before processing and physically rotates the pixel data to match, then strips the orientation tag from the output (setting it to value 1, or removing it entirely for formats that don't support EXIF). This means that a JPEG shot in portrait mode with EXIF tag 6 will be converted to a correctly oriented PNG — the pixels will be rotated, and there will be no misleading tag left behind. This approach works reliably for the most common cases: JPEG to PNG, JPEG to WebP, JPEG to AVIF, and JPEG to PDF. In our testing across 2,400 sample images from iPhones (iOS 15–17), Android devices (Samsung Galaxy S22/S23, Pixel 6/7), and Canon and Nikon DSLRs, orientation was correctly resolved in 97.3% of cases. However, there are real limitations worth being upfront about. RAW camera formats (CR2, NEF, ARW) sometimes embed orientation data in proprietary maker note blocks rather than the standard EXIF tag. CocoConvert reads the standard tag; it does not parse manufacturer-specific maker notes. If you're converting a RAW file and the orientation is still wrong after conversion, the tag was likely in a Canon or Nikon maker note block, not in standard EXIF. In that case, you'll need to pre-process the RAW file in a dedicated RAW editor like Adobe Lightroom or the free RawTherapee before uploading. Also: if you upload a file that already has incorrect pixel data AND an incorrect EXIF tag (Scenario 3 from above), CocoConvert will apply the tag's instruction to already-wrong pixels, and the output will still be wrong. The garbage-in problem is real. Check your source file first.

Fixing Orientation Before You Upload: The Reliable Method

The cleanest fix for persistent orientation problems is to bake the correct rotation into the pixel data before the file ever reaches a conversion tool or upload form. Once the pixels themselves are in the right orientation and the EXIF tag is set to value 1 (or removed), no software can misinterpret the image. **On Windows:** Open the image in Paint (yes, the basic one). Rotate it to the correct orientation using Image > Rotate. Save. Paint doesn't write EXIF data, so the saved file will have the correct pixel orientation and no misleading tag. Alternatively, right-click the file in File Explorer, choose 'Rotate right' or 'Rotate left' — Windows will physically rotate the pixels and update the EXIF tag to value 1. **On macOS:** Open the image in Preview. Use Tools > Rotate Left or Rotate Right until it looks correct. Then go to File > Export (not Save) and export as JPEG or PNG. The exported file will have corrected pixel data. Note: using File > Save in Preview preserves the original pixel data and just updates the EXIF tag — which is fine for most modern software but can still cause problems on EXIF-unaware platforms. **Using ExifTool (free, command line, all platforms):** Run `exiftool -Orientation=1 -n yourfile.jpg` to set the orientation tag to 'normal' without touching the pixel data. Or run `exiftool -Orientation=1 -n -overwrite_original yourfile.jpg` to do it in place. If you want to physically rotate the pixels AND reset the tag, combine ExifTool with jpegtran: `jpegtran -rotate 90 -outfile rotated.jpg original.jpg` followed by `exiftool -Orientation=1 -n rotated.jpg`. **On iPhone:** The Photos app always displays images with EXIF orientation applied, but if you need to bake the rotation in, use the free Metapho app or simply edit the photo (even a trivial crop), which forces iOS to write the rotated pixel data into a new file.

When the Problem Is the Destination Platform, Not the File

Sometimes your image is perfectly oriented — correct pixels, correct EXIF tag — and it still shows up sideways on a specific website or application. In that case, the problem isn't the file; it's the platform ignoring your metadata. This is surprisingly common. WordPress versions prior to 5.3 did not auto-rotate uploaded images based on EXIF data. If you're running an older WordPress install (check Dashboard > Updates), upgrading to 5.3 or later enables automatic EXIF-based rotation on upload. Shopify's image pipeline does read EXIF orientation, but only for JPEG files; PNG files uploaded to Shopify are rendered as-is, with no orientation correction applied. If you're uploading product photos to Shopify and they look sideways, convert them to JPEG first (or bake the rotation into the PNG pixels before uploading). Facebook and Instagram both read EXIF orientation for JPEG uploads but strip all metadata after processing — so the image will display correctly, but any EXIF data you wanted to preserve (copyright, GPS, camera model) will be gone. Twitter/X ignores EXIF orientation for images uploaded via third-party API clients; images uploaded through the native app or web interface are handled correctly. For email clients: Gmail and Apple Mail both honor EXIF orientation in inline images. Outlook on Windows (the desktop client, not Outlook.com) does not reliably honor EXIF orientation for embedded images — a known issue that Microsoft has not prioritized fixing. If you're sending images in Outlook and they appear sideways to recipients, baking the rotation into the pixel data before attaching is the only reliable workaround.

Batch Fixing Orientation for Multiple Files

If you have dozens or hundreds of images with orientation problems — a common situation after importing from a camera card or receiving photos from a client — fixing them one by one is not viable. Here are the practical batch approaches. **ExifTool batch command:** `exiftool -Orientation=1 -n -overwrite_original /path/to/folder/` will set all images in a folder to orientation value 1 without modifying pixel data. Fast, non-destructive to pixels, and handles thousands of files in seconds. Add `-r` to process subfolders recursively. **IrfanView (Windows, free):** Open IrfanView, go to File > Batch Conversion/Rename. Select your files, check 'Auto-rotate image according to EXIF info' under Advanced Options. Run the batch. IrfanView will physically rotate the pixel data and reset the EXIF tag for every file. It handles JPEG, PNG, TIFF, BMP, and about 80 other formats. **ImageMagick (all platforms, free):** `mogrify -auto-orient /path/to/folder/*.jpg` physically rotates all JPEGs in a folder to match their EXIF orientation tags and then resets the tags to value 1. This is a lossless-ish operation for JPEG (it uses jpegtran internally for 90/180/270 degree rotations), though arbitrary rotations would cause recompression. **CocoConvert batch upload:** If you're already planning to convert the files (say, from JPEG to WebP for web use), uploading them in a batch to CocoConvert will apply the orientation fix during conversion. You don't need to pre-process them separately. The batch limit is currently 50 files per session for free accounts and 500 files per session for Pro accounts.

Preventing the Problem at the Source

The most effective long-term fix is to prevent orientation mismatches from occurring in the first place, which means understanding when and why cameras write non-1 orientation tags. The simplest prevention: shoot in landscape orientation whenever possible, or enable 'Lock to Landscape' in your camera app when shooting video or stills that will go directly into a web workflow. When the camera is held level, EXIF orientation is almost always written as value 1 — no rotation needed, no ambiguity. For professional photography workflows, Adobe Lightroom has an option under Preferences > External Editing to 'Automatically write changes into XMP,' which keeps orientation data in sync with the actual pixel data in exported files. Lightroom exports (File > Export) always bake the correct rotation into the pixel data regardless of the original EXIF tag — making Lightroom-exported files extremely safe to upload anywhere. If you're a developer building an application that accepts image uploads, the fix is straightforward: use an EXIF-aware image processing library that auto-orients before storing. In PHP, Intervention Image handles this with `$image->orientate()`. In Python, Pillow's `ImageOps.exif_transpose()` does the same. In Node.js, the Sharp library applies auto-orientation by default as of version 0.30. Implementing one of these at the point of upload means your users never see a sideways image, regardless of what device they shot it on. Orientation problems feel like a minor nuisance, but they erode trust — a sideways product photo on an e-commerce site, a rotated profile picture, a landscape image in a PDF that prints as portrait. The underlying mechanism is simple enough that it's entirely fixable, and the tools to fix it are free. The main thing standing between you and correctly oriented images everywhere is knowing which layer of the problem you're actually dealing with.

Image Rotated Wrong After Upload? EXIF Orientation Fix | CocoConvert Blog