Hello,
I'm facing an issue where images have red tint on the renditions, while the original image is totally fine.
We're using AEM 6.5 with SP 6.5.21.0 and renditions are generated using MediaHandler from package https://wcm.io/media-handler.
What I've manage to figure out is that when the images size is bigger, for example over 2-3 MBs, the renditions have red tint, but after compressing the image, then it's fine.
The main issue here is that this is happening only on one environment, while the others are totally fine, even with the bigger images.
Any ideas what could be the issue here? I've added a new logger for that package with DEBUG level, but no indicators, as well nothing in the error.log.
Could there be some heap space issue, or is there any OSGi config doing some limitation on asset storage size / renditions? Currently our storage contains about ~40GB of assets.
Thanks in advance.
Example of an invalid picture:
Views
Replies
Total Likes
Hi @MatijaLeskovic,
Since the originals are fine and smaller versions work without a problem, it definitely points to something environment-specific.
A few things you might want to try:
1. Check the Java setup
Run java -version
on the environment where it’s failing and compare it with a working one. Sometimes different Java vendors or versions (like OpenJDK vs Oracle JDK) can behave differently when it comes to image rendering.
2. Look into memory settings
It's worth taking a look at your heap size and other memory settings (-Xmx
, -Xms
) in that environment. If it’s running low on memory during image processing, it might not crash, but could produce weird results like this red tint. Try increasing the heap size a bit and see if that helps.
3. Make sure Java isn’t running in headless mode (just for testing)
If the environment is using -Djava.awt.headless=true
, try temporarily disabling it by setting it to false
and see if that changes anything. Sometimes headless mode messes with image rendering, especially with certain color profiles.
4. Enable a bit more logging
You already added DEBUG for the media handler, which is great. You can also try turning on logs for:
javax.imageio
com.sun.imageio.plugins
That might give more clues if something is silently failing during rendition generation.
Hope that helps!
Can you check if you have quality configurations?
Views
Replies
Total Likes
Hi @MatijaLeskovic ,
Since the issue is environment-specific and size-dependent, probable causes are:
- Java ImageIO color profile issue (often with CMYK JPEGs)
- Java vendor/version inconsistencies
- headless mode affecting rendering
- Low memory or heap pressure during image conversion
- Missing or corrupted imageio plugins or fonts
- Incorrect or missing quality or MediaHandler config
1. Check Java Version and Vendor
On both environments:
java -version
Compare Java vendor (Oracle JDK vs OpenJDK), and versions.
Use Oracle JDK 11 or at least the same JDK across all AEM environments for consistency.
2. Check for Headless Mode
Open the AEM start script or check process flags for:
-Djava.awt.headless=true
Try disabling it temporarily:
-Djava.awt.headless=false
In headless mode, several image rendering libraries exhibit improper behavior, particularly when handling color profiles (such as CMYK > RGB conversions).
3. Raise Memory & Heap Configurations
Large file image conversion may be silently failing because of memory pressure, even if the server in question doesn't crash.
Verify the current Xmx, Xms, and XX:MaxPermSize flags, and if they are low, raise them.
For instance:
-Xms2g -Xmx4g
Patch the Quality Settings (MediaHandler Configuration)
Verify your MediaHandler OSGi parameters, paying particular attention to the quality and format options.
Configuration example:
mediahandler.asset.autoRendition.quality = 0.85
Use the OSGi Console to configure this: http://localhost:4502/system/console/configMgr/io.wcm.handler.media.impl.asset.RenditionHandlerImpl
Channel corruption or red tints may occur if the quality is too poor or if the preset compression is not successful.
5. Install the ImageIO plugins that are missing.
Java's ImageIO may malfunction silently and provide distorted renditions if huge files contain CMYK profiles and your server is not compatible.
Use the most reliable option, the TwelveMonkeys ImageIO plugin:
- JARs can be downloaded at https://github.com/haraldk/TwelveMonkeys.
- Place these in /crx-quickstart/install/ or use the OSGi bundle to deploy.
- Restart AEM
Modules required:
imageio-core
imageio-jpeg
imageio-tiff
imageio-metadata
This adds support for CMYK JPEGs and advanced profiles.
6. Enable Verbose ImageIO Logging
Add to AEM start command or set via sling.properties:
-Djava.util.logging.config.file=/path/to/logging.properties
Sample logging.properties:
handlers= java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level = FINE
javax.imageio.level = FINE
com.sun.imageio.plugins.level = FINE
7. Compare the Original and Compressed Versions
Since the problem is fixed by compression, try:
Reduce the original's resolution or convert it to sRGB.
Compare renditions in both contexts after re-uploading.
The red tint is probably caused by a failed color profile interpretation if the original was CMYK with an ICC profile.
8. Examine the X11 packages and typeface (Linux only)
If your AEM is Linux-based and renders using graphical libraries or fonts, compare:
fc-list
dpkg -l | grep font
Ensure all image/font rendering packages are installed.
Regards,
Amit
Views
Replies
Total Likes
Views
Likes
Replies