1# Obtaining the Rotation Angle of an Image 2<!--Kit: Image Kit--> 3<!--Subsystem: Multimedia--> 4<!--Owner: @aulight02--> 5<!--Designer: @liyang_bryan--> 6<!--Tester: @xchaosioda--> 7<!--Adviser: @zengyawen--> 8 9## Introduction to Image Rotation Angles 10 11In digital photography, the shooting device (such as a smartphone or camera) saves the rotation angle (orientation) information of the image in the **Orientation** field of the Exchangeable Image File Format (EXIF) data of the image. The information does not alter the pixel content of the image. It instructs the image viewer how to correctly display the image orientation. 12 13The EXIF standard defines the orientation values, their corresponding string representations, and operational instructions, as listed in the table below. 14 15| Value | String Representation | Operational Instructions | 16|--------|----------------|--------------------------------| 17| 1 | "Top-left" | Normal orientation (no rotation required). | 18| 2 | "Top-right" | Horizontal mirror flip. | 19| 3 | "Bottom-right" | Rotate 180°. | 20| 4 | "Bottom-left" | Vertical mirror flip. | 21| 5 | "Left-top" | Horizontal mirror flip followed by a clockwise rotation of 270°.| 22| 6 | "Right-top" | Clockwise rotation of 90°. | 23| 7 | "Right-bottom" | Horizontal mirror flip followed by a clockwise rotation of 90°.| 24| 8 | "Left-bottom" | Clockwise rotation of 270°. | 25 26In ArkTS scenarios, for details about how to read and edit the rotation angle information of an image, see [Editing EXIF Data](../image-tool.md). The corresponding **propertyKey** must be set to **ORIENTATION**. 27 28In C/C++ scenarios, for details about how to read and edit the rotation angle information of an image, see [Using Image_NativeModule to Edit EXIF Data](../image-tool-c.md). The corresponding **key** must be set to **OHOS_IMAGE_PROPERTY_ORIENTATION**. 29 30## FAQs 31 32### What should I do If the image rotation angle is null? 33 34Some images may lack EXIF data or may not have the **Orientation** field written in the EXIF data. These images do not require rotation (consistent with the case where **Orientation** is 1). 35 36### Why EXIF Data might be lost? 37 38This is related to the source of the image. Images transmitted over the network may have been re-encoded without preserving EXIF data. As a result, the rotation angle cannot be obtained. 39 40### How do I save EXIF data during image encoding? 41 42When calling the image encoding API, set **needsPackProperties** of [packingOption](../../../reference/apis-image-kit/arkts-apis-image-i.md#packingoption) to **true**. (The default value is **false**.) 43