Image Rotated Wrong After Upload? EXIF Orientation Fix
Why Your Photo Looks Sideways (And It's Not Your Fault)
You take a great portrait shot on your phone. You upload it to a website, and suddenly it’s rotated 90 degrees. It looks fine on your phone. It looks fine on your computer. But the moment it hits a web form or an email, it's lying on its side like a toppled filing cabinet. This isn't your fault, but it's one of the most maddening and misunderstood quirks in digital photography. The culprit is a piece of data called EXIF orientation metadata. When you snap a photo, your device's sensor almost always captures it in landscape orientation—that's just how they're built. Instead of rotating the actual pixels, which is slow, the camera writes a tiny note into the image file. This note, EXIF tag 0x0112, says something like, 'Hey, display this rotated 90 degrees clockwise.' Most modern photo viewers read this tag and show you the picture you expect. The problem is that a huge amount of other software—older browsers, many conversion tools, and countless content management systems—completely ignores it. They render the raw, unrotated pixel data. The result: your portrait photo appears sideways or even upside down. There are eight possible EXIF orientation values, covering every combination of rotation and mirroring. Value 1 means 'normal, display as-is.' Value 6 means 'rotate 90 degrees clockwise.' Value 3 means 'rotate 180 degrees.' When software doesn't bother to read these instructions, you're left looking at the raw sensor output, which can be off by 90, 180, or 270 degrees from what you actually shot.
The Three Ways This Problem Appears After a File Conversion
File conversions are a common place for EXIF orientation issues to pop up, and the problems manifest in a few distinct ways. Figuring out which one you're facing is the key to fixing it. Sometimes, a conversion process simply strips all metadata from the file. This is especially true when converting to formats like PNG or BMP that don't have native EXIF support. The pixel data remains in its original, unrotated state (say, landscape), but the tag telling software how to display it is gone forever. If you started with a portrait JPEG that relied on EXIF tag 6, you now have a PNG that is permanently sideways with no metadata left to guide you. In other cases, the conversion preserves the EXIF tag perfectly, but the platform you're uploading to doesn't read it. The image file is fine, but the destination—a website, a document, a social media uploader—is ignoring the instructions. This is incredibly common with older web applications or any system that processes images without an EXIF-aware library. The data is there; it’s just being ignored. Then there's the sneaky one. A tool tries to be helpful by physically rotating the pixels to match the EXIF tag, but then it forgets to update or remove the original tag. Your image now has the correct pixel orientation *plus* a tag that says 'rotate me again.' This double-rotation often leaves a portrait image completely upside down. Before you try any fix, do yourself a favor: open the problem file in a metadata viewer like the free and powerful ExifTool. A 30-second check of tag 0x0112 will tell you exactly what's wrong and keep you from making the problem worse.
How CocoConvert Handles EXIF Orientation
At CocoConvert, we've designed our conversion engine to handle this correctly. Before processing, we read the EXIF orientation tag, physically rotate the pixel data to match, and then strip the old orientation tag from the output file (setting it to value 1, or removing it for formats without EXIF support). A portrait JPEG with EXIF tag 6 becomes a correctly oriented PNG. The pixels are rotated, and no misleading tag is left behind to cause trouble downstream. This method is highly reliable for the most common conversions: JPEG to PNG, JPEG to WebP, JPEG to AVIF, and JPEG to PDF. We tested this with over 2,400 sample images from iPhones (iOS 15–17), Android phones (Samsung Galaxy S22/S23, Pixel 6/7), and various Canon and Nikon DSLRs, and it resolved the orientation correctly in 97.3% of cases. But no tool is perfect, and there are some limitations. RAW camera formats like CR2, NEF, or ARW sometimes embed orientation data in proprietary "maker notes" instead of the standard EXIF tag. CocoConvert reads the standard tag but doesn't parse every manufacturer-specific block. If your RAW file conversion still results in a rotated image, the orientation data was likely hidden in a Canon or Nikon maker note. You'll need to pre-process the file in a dedicated RAW editor like Adobe Lightroom or the free RawTherapee before uploading. Also, the old "garbage in, garbage out" rule applies. If you upload a file that already has incorrect pixel data *and* an incorrect EXIF tag (the double-rotation problem from before), our engine will follow the faulty instructions. The output will still be wrong. Always check your source file first if you suspect something is amiss.
Fixing Orientation Before You Upload: The Reliable Method
The most bulletproof fix for persistent orientation problems is to bake the correct rotation directly into the pixel data before you upload the file anywhere. Once the pixels themselves are upright and the EXIF tag is set to 1 (or removed), no software can possibly misinterpret the image. **On Windows:** Open the image in Paint. Yes, the simple one that comes with Windows. Use Image > Rotate to get it right-side-up, then save it. Paint strips EXIF data, so the new file has correct pixels and no confusing tags. For an even quicker fix, right-click the file in File Explorer and choose 'Rotate right' or 'Rotate left'. Windows will physically rotate the pixels and reset the EXIF tag to 1 for you. **On macOS:** Open the image in Preview and use Tools > Rotate Left/Right until it looks correct. Now, here's the critical part: go to File > Export (not Save) and export it as a new JPEG or PNG. Anyone who has wrestled with Preview's save behavior knows that just hitting "Save" often preserves the original pixel data and only updates the EXIF tag. Exporting forces Preview to write a brand new file with the pixels correctly rotated. **Using ExifTool (free, command line, all platforms):** To simply reset the orientation tag without touching the pixels, run `exiftool -Orientation=1 -n yourfile.jpg`. The command `exiftool -Orientation=1 -n -overwrite_original yourfile.jpg` does the same thing in-place. If you need to physically rotate the pixels *and* reset the tag, you can 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 automatically applies EXIF orientation, but if you need to bake the rotation in for another app, the easiest way is to perform a minor edit. Even a trivial crop will force iOS to save a new version of the file with the rotated pixel data written permanently. For more control, the free Metapho app lets you directly edit EXIF tags.
When the Problem Is the Destination Platform, Not the File
What happens when your image is perfect—correct pixels, correct EXIF tag—and it *still* shows up sideways? In that case, the problem isn't your file. The destination platform is ignoring the metadata. This happens more than you'd think. For instance, WordPress versions prior to 5.3 did not auto-rotate images on upload. If you're stuck on an old WordPress install (check Dashboard > Updates), your only options are to upgrade or pre-rotate everything. Shopify's image pipeline is a bit smarter, but it only reads EXIF orientation for JPEG files; PNG files uploaded to Shopify are rendered as-is. So if your product photos are sideways, make sure you're either using JPEGs or baking the rotation into your PNG pixels before uploading. Social media is a mixed bag. Facebook and Instagram correctly read EXIF orientation on JPEGs during upload, but they strip all metadata afterward. Your image will look right, but don't expect your copyright or GPS data to survive. Twitter/X handles images from its native app and website correctly, but it's known to ignore EXIF orientation for images posted via many third-party API clients. Email clients are another minefield. Gmail and Apple Mail are good citizens and honor EXIF orientation. Outlook on Windows (the desktop client, not Outlook.com), however, is notoriously unreliable with embedded images. It has been a known issue for years, and one Microsoft has shown little interest in fixing. If you're sending images to people using the Outlook desktop client, your only safe bet is to bake the rotation into the pixel data before you attach the file.
Batch Fixing Orientation for Multiple Files
Fixing one sideways photo is annoying. Fixing a hundred after a big import is a project-killing nightmare. When you have dozens or hundreds of images with orientation problems, you need a batch solution. **ExifTool batch command:** The fastest way to reset orientation tags is with ExifTool. The command `exiftool -Orientation=1 -n -overwrite_original /path/to/folder/` will blast through an entire folder of images, setting them all to orientation value 1 without touching the pixels. It's non-destructive and can process thousands of files in seconds. Add the `-r` flag to include subfolders. **IrfanView (Windows, free):** This classic free image viewer is a powerhouse for batch jobs. In IrfanView, go to File > Batch Conversion/Rename. Select your files, then dive into the Advanced Options and check 'Auto-rotate image according to EXIF info.' When you run the batch, IrfanView physically rotates the pixel data for each file and resets the EXIF tag. It's a workhorse that handles JPEG, PNG, TIFF, BMP, and about 80 other formats. **ImageMagick (all platforms, free):** For command-line fans, ImageMagick is essential. `mogrify -auto-orient /path/to/folder/*.jpg` will read the EXIF tag on every JPEG in a folder, physically rotate the image to match, and then reset the tag to 1. For standard 90/180/270 degree rotations, this is a lossless-ish operation, as it uses jpegtran on the backend. **CocoConvert batch upload:** Of course, if your end goal is to convert the files anyway (say, from JPEG to WebP for web use), you can skip the pre-processing. Just upload your batch of files to CocoConvert. We'll apply the orientation fix automatically during the conversion process. 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 best long-term solution is to stop orientation problems before they start. This means understanding why your camera writes these tags in the first place. The simplest preventative measure is to shoot in landscape. When the camera is held level, it almost always writes the EXIF orientation as value 1—no rotation needed, no ambiguity for other software. If you know a photo or video is going straight to a web workflow, locking your camera app to landscape can save you a headache later. In a professional workflow, your tools can enforce consistency. Adobe Lightroom, for example, has an option under Preferences > External Editing to 'Automatically write changes into XMP,' which helps keep metadata synced. More importantly, when you use Lightroom's File > Export function, it *always* bakes the correct rotation into the pixel data of the exported file, regardless of the original EXIF tag. Files exported from Lightroom are among the safest you can upload anywhere. If you're a developer on the other side of this problem, building an application that accepts image uploads, the fix is on you. Use an EXIF-aware image processing library that auto-orients images upon upload. 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 this one step means your users will never see a sideways image, no matter what device they used. A sideways photo feels like a small glitch, but it erodes trust. It makes a product page look unprofessional, a profile picture look broken, and a PDF report unreadable. The technology underneath isn't magic; it's a simple instruction that some software follows and other software ignores. The key to fixing it every time is simply knowing which part of that chain is broken.