Hey There,
I have a question related to image orientation.
A user pointed to a batch of images they recently uploaded, that after ingesting to the AEM DAM they got a wrong rotation in renditions as well as thumbnail in Card View. The main image is oriented correctly. A few renditions rotated the image CCW 90 dgs. Why is that? How can this be fixed?
Most of the images in the DAM are oriented correctly. The workflow is the same to all and has had no changes. Please see an example below. The pattern is the same throughout.
Many thanks!
.
Views
Replies
Total Likes
Hi @PovEim,
When images are uploaded to AEM DAM and you notice that some renditions or thumbnails are rotated incorrectly (e.g., 90° counterclockwise) even though the main/original image appears correctly this is caused by:
Web browsers and some image viewers respect the EXIF orientation — that’s why the original image looks correct.
However, AEM’s rendition generation process (using tools like ImageMagick or Java APIs) often ignores the EXIF orientation, resulting in a visibly rotated rendition.
Solutions
Option 1: Preprocess Images Before Upload (Best Practice)
Before uploading images to AEM, apply the orientation physically and remove the EXIF tag.
Command using ImageMagick:
mogrify -auto-orient -strip *.jpg
-auto-orient: Rotates the image pixels according to the EXIF tag.
-strip: Removes all metadata (including the orientation tag) so the image displays consistently everywhere.
This can be run on Mac, Linux, or Windows (with ImageMagick installed).
This is the most reliable and future-proof solution.
Option 2: Customize AEM DAM Workflow
If you control the AEM instance, you can:
Modify the “DAM Update Asset” workflow.
Add a custom step that applies orientation (e.g., using a Java ImageIO extension or command-line tool).
This ensures renditions are generated with the correct rotation automatically at ingestion.
AEM developers can implement this via OSGi workflow process steps.
Option 3: Reprocess Affected Assets
For already-ingested assets showing the wrong orientation:
Download them locally.
Run mogrify -auto-orient -strip to fix the image.
Re-upload them to AEM or re-run the DAM Update Asset workflow.
Hi @PovEim,
I think, this is a known issue related to how AEM processes image orientation metadata - specifically the EXIF orientation tag embedded in JPEG images taken with cameras or smartphones.
Images captured by cameras often store the orientation in an EXIF tag instead of physically rotating the pixel data.
When you upload such an image to AEM DAM:
The original binary remains correct because viewers read the EXIF tag to auto-rotate.
AEM’s DAM Update Asset workflow (specifically the DAM Rendition Step
) uses ImageMagick or Java ImageIO to generate renditions and thumbnails.
Some image processing libraries ignore the EXIF orientation tag and just render the raw pixels — resulting in rotated renditions and thumbnails.
If using ImageMagick (which AEMaaCS may be configured to use internally):
Ensure the command includes the -auto-orient
flag.
In custom workflows or external rendition tools, apply auto-orientation during processing.
ACS AEM Commons provides a process step called “Image Orientation Corrector”.
Add this step before the DAM Update Asset step in your workflow.
It reads the EXIF orientation and physically rotates the image, removing the tag afterward — ensuring correct orientation for all renditions and thumbnails.
For already affected images, re-run the modified DAM Update Asset workflow after fixing the orientation.
You can use the “Reprocess Asset” option or write a script to batch process them.
Hope that helps!
Thank you @SantoshSai and @AmitVishwakarma for your answers and solutions! I will ask for help from our devs team re auto-orient.
Also just sharing my workaround in this situation:
- I too figured the issue re phone rotation and exif data
- It can be confirmed if a problematic image is saved on Mac. One needs to open it with Preview app. Then go Tools > Show Inspector (or CMD + I)
- Then in Info tab check Orientation. If the image is displayed correctly, but orientation does not say 1 Normal, then there will be an issue with the AEM.
- Quick fix - open image in Photoshop and save it. Make no changes, just Save image. This changes Exif orientation to 1 Normal.
- Re-upload the image to the DAM.
Thanks