Reorient Images
Orient the image right
https://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.jpg?environment={environment_name}&orient={orient_value}Note Check out the limitations that are applicable here.
Now let’s flip the image horizontally.
Flip the image horizontally
https://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.jpg?environment={environment_name}&orient={orient_value}Note Check out the limitations that are applicable here.
You can also use a combination of the two example given above. So, in the following API request, the image will be flipped horizontally, and then orient it right.
Flip horizontally and orient right
https://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.jpg?environment={environment_name}&orient={orient_value}Note Check out the limitations that are applicable here.
Additional Notes
- This parameter can automatically correct the orientation of the image if the source image contains orientation details within its EXIF data (Exchangeable Image File Format).
The orient parameter lets you control the cardinal orientation of the given image. Using this parameter, you can orient the image right or left, flip horizontally or vertically or both, and do a lot more. It can automatically correct the orientation of the image if the source image contains orientation details within its EXIF data (Exchangeable Image File Format).
You can use any of the following values for the orient parameter:
- 1 - Set image to default
- 2 - Flip image horizontally
- 3 - Flip image horizontally and vertically
- 4 - Flip image vertically
- 5 - Flip image horizontally and then rotate 90 degrees towards left
- 6 - Rotate image 90 degrees towards right
- 7 - Flip image horizontally and then rotate 90 degrees towards right
- 8 - Rotate image 90 degrees towards left
Let’s try to change the orientation of the image. Use the request given below to orient the image right.