Why Xiaomi smartphones turn over photos: technical reasons and solutions

You took the perfect shot on your Xiaomi Redmi Note 12 or POCO X5 Pro, but when viewed in the gallery, the photo was turned over 90Β° And this is a problem that many smartphone owners of the brand know -- and it's not always about camera failure. 80 percent of the time, the software settings, the processing, are to blame. EXIF-metadata.

In this article, we’ll take a closer look at 7 main reasons Xiaomi can automatically turn your photos, from MIUI firmware bugs to camera module hardware nuances, and how to turn off autorotation in the standard Camera app, what settings affect the orientation of images when transmitting via Bluetooth or downloading to social networks, and why some models (such as Xiaomi 13 Ultra) suffer from this problem more often than others.

Particular attention will be paid to the hidden parameters of the developer, which allow you to manually set the orientation of the camera sensor - this method works even on devices with custom firmware such as PixelExperience or LineageOS. And at the end of the article you will find a step-by-step instruction to restore the original orientation of the photo using the EXIF Tool and FFmpeg tools.

1. Autoturn in the application β€œCamera”: how it works and why it fails

The main reason for the upside-down photos on Xiaomi is because of the image processing algorithms embedded in the standard Camera app, because the smartphone determines the orientation of the image not only from the gyroscope, but also from the gyroscope. EXIF-Tags are meta-information that is written into a photo file, and if those tags conflict with the physical position of the device, the automatic rotation occurs.

For example, when you are taking a portrait (vertically) but hold your phone upside down (the camera on the bottom), MIUI may misinterpret the accelerometer data and write Orientation=6 (a 90Β° clockwise rotation) instead of Orientation=8 (270Β°) in EXIF, which results in the photo being upside down, when the problem is actually only metadata.

  • πŸ”„ Sensor conflict: A gyroscope and accelerometer transmit conflicting device position data.
  • πŸ“± bug MIUI: In the firmware MIUI 13–14 processing errors recorded EXIF In the camera module (especially on models with Sony) IMX766).
  • πŸ”§ Default settings: Some regional versions of the software include forced autorotation for β€œconvenienceΒ».

Interestingly, the problem is more common when shooting in HEIF/HEIC (used by default on new Xiaomi to save space), which is more sensitive to errors in metadata than the classic JPEG.

πŸ“Š How often does your Xiaomi turn over a photo?
Constantly.
Sometimes.
It used to be, it's not now.
Never noticed.

Hardware causes: the role of the gyroscope and camera module

If the photo flip is systemically (in all images regardless of the application), the hardware components may be to blame. For example, Xiaomi 12T Pro and Redmi K50 Gaming models use 5-axis stabilization cameras, where the orientation sensor is physically displaced relative to the body, which leads to the fact that:

⚠️ Attention: If after the fall of the smartphone, the photos began to turn only when shooting from the main camera (frontal works normally), this may indicate a mechanical displacement of the module.

  • πŸ“ Sensor misalignment: The camera is physically mounted at an angle to the body (typical for devices with a "bulging" islet of cameras).
  • πŸ”© Damage to the gyroscope: After impact or moisture, the sensor may give incorrect data.
  • πŸ”Œ Problems with the plume: On models POCO F4 GT and Black Shark 5 camera plume sometimes departs from the board, which leads to failures in the transmission of orientation data.

Check the hardware nature of the problem is simple: install a third-party camera app (such as Open Camera or GCam) and take test shots. If the photos are saved in the correct orientation, it is Xiaomi's fault, if not, it needs repair.

How to check the gyroscope for performance?
Open the engineering menu with code ##6484## (for MIUI) and select Sensor Test. In the Gyroscope section, look for the values along the X/Y/Z axes - they should change as the device rotates. If the readings "frozen" or gallop randomly, the sensor is faulty.

3. Impact of firmware and regional settings MIUI

Firmware MIUI It has regional features that directly affect the processing of photos (CN) Global (Global) versions of the software use different recording algorithms. EXIF-And that leads to the fact that:

MIUI versionTurning problemDependence on the model
MIUI CN (China)The autoturn is off by default, but EXIF-tags are not written correctly for horizontal images.More often on Xiaomi 13/14 series.
MIUI Global/EEAForced rotation is on, but sometimes it is delayed (photo turns 1-2 seconds after shooting).It is typical of the Redmi Note 11/12.
MIUI for POCOBug with a 180Β° rotation when shooting in Pro Mode.POCO X4 Pro 5G, POCO F5.

Another nuance is the firmware updates. MIUI 14.0.4 Many users of Xiaomi 12S Ultra complained about a spontaneous photo turn in the gallery, because of a library error. libmiui_camera.so, responsible for the processing of metadata:

  1. Reverse to the previous version of the software via Fastboot.
  2. Or wait for a patch (usually comes out 2-3 weeks after mass complaints).

πŸ’‘

Before updating your firmware, back up your photos in their original form. Connect your smartphone to your PC and copy the DCIM/Camera folder unchanged.

Sometimes the photos are displayed correctly in the standard gallery. MIUI, But flipped when viewed in Google Photos, VK Or when you send it through Telegram, which is because different apps interpret things differently. EXIF-tags, for example:

  • πŸ–ΌοΈ Google Photos: Ignores Orientation tag and turns photo based on image analysis (AI sometimes gets it wrong).
  • πŸ“± VK/Instagram: When loading, automatically apply the rotation EXIF, But sometimes they fail because of compression.
  • πŸ’¬ Telegram/WhatsApp: Turn the photo if the metadata indicates Rotation=90, But the picture is physically turned.

Decision:

  1. Open the photo in the standard MIUI gallery and click Edit β†’ Turn β†’ Reset.
  2. Use apps that ignore EXIF, such as Simple Gallery.
  3. Before sending, convert the photo to JPEG using Lightroom Mobile (this will reset the metadata).

On Xiaomi models with a Snapdragon 8 Gen 2 processor (for example, Xiaomi 13 Pro), there is another feature: when shooting in RAW (.dng format), photos are saved without autorotating, but the MIUI gallery may display them incorrectly, in which case viewing through Adobe Lightroom or Snapseed will help.

5. Manual correction of orientation photo: step-by-step instructions

If automatic solution is not possible (for example, on custom firmware), you can manually correct the orientation of the photo using specialized tools.

Install EXIF Tool (Android) or ExifTool (PC) | Download FFmpeg for mass processing | Backup photo | Check the free space on the device

-->

Method 1: Using the EXIF Tool (on the phone)

  1. Install the EXIF Editor app from Google Play.
  2. Open the problem photo and find the Orientation field.
  3. Set the value: 1 - normal orientation; 6 - turn 90 Β° hourly; 8 - turn 270 Β° (or 90 Β° against the hourly).

Save the changes and check the photo in the gallery.

Method 2: Through FFmpeg (on PC)

For mass correction, use the command:

ffmpeg -i input.jpg -metadata:s:v rotate="0" -codec copy output.jpg

Where rotate="0" is the desired orientation (substitute 90, 180 or 270 if necessary).

πŸ’‘

If the photos are only turned over when viewed on a PC, the problem lies in the Windows settings. Open Settings β†’ Devices β†’ Autoturn and turn off the option to Lock the Screen Turn.

6.Hidden developer settings for Xiaomi camera

MIUI has hidden parameters that allow you to manually control the camera's orientation, so you can activate them.

  1. Go to Settings. β†’ The phone.
  2. Click 7 times on the MIUI version to enable Developer Mode.
  3. Back to Settings β†’ Additionally. β†’ For developers.
  4. Find Camera Debugging (or Camera HAL on new models).
  5. Activate Force Camera Orientation and select 0 (turn off autorotation).

If you often take pictures from non-standard angles (such as macro or low angle), try:

  1. Activate Professional Mode in the Camera app - it saves a photo without autoturning.
  2. Use it. RAW+JPEG (support-model) β€” RAW-Files are not affected by bug.
πŸ“Š What camera app are you using on Xiaomi?
Standard.
GCam
Open Camera
Other

FAQ: Frequent questions about upside-down photos on Xiaomi

Why are photos normal in a gallery but flipped when sent to WhatsApp?
WhatsApp uses its own image processing algorithms. EXIF-Tags indicate a turn, but the photo is physically rotated, the messenger applies a turn twice. Solution: before sending the photo, open the editor and save it unchanged (this will reset the metadata).
Can I turn off the car forever?
Yes, but it requires root rights or ADB. The alternative is to disable the Autoturn option in the system settings (although it will affect other applications too).
Why do you only turn over selfies, but not the main camera photos?
This is because the front camera on Xiaomi is often upside down (for the convenience of the plume location).The software compensates for this programmatically, but sometimes it is mistaken. Check the frontal settings: some versions of MIUI have a separate Mirror selfie switch that affects orientation.
How to restore the original orientation of the photo after a turn?
Use ExifTool with the command: Exiftool -n -Orientation=1 -overwrite_original input.jpg This will bring the whole photo to a "normal" orientation. -r And put the folder in.
Will resetting the phone to factory settings help?
60 percent of the time, yes, but only if the problem is software. Before resetting, export the photos to your PC, because they will be deleted. After resetting, don't restore the settings from the MIUI backup, which can return the bug.