Issue
- Adaptive Media cannot process some images, but the only info about these errors is found in the UI alone, as shown in the image below. No related errors can be found in the logs.
Environment
- Liferay DXP 7.0+.
Resolution
- Some logs must be enabled to get more specific information about the images that failed during the process. Make sure the following classes' logs are configured to WARN level:
com.liferay.adaptive.media.document.library.web.internal.optimizer.DLAMImageOptimizer
And this one to DEBUG level:com.liferay.adaptive.media.image.internal.util.RenderedImageUtil
- So now you will be able to see errors like:
2021-04-20 10:05:27.161 WARN [liferay/background_task-8][DLAMImageOptimizer:161] Unable to process file entry 9560484
And more specific exceptions like:2021-04-26 14:55:05.114 DEBUG [liferay/background_task-10][RenderedImageUtil:100] java.lang.ArrayIndexOutOfBoundsException: 4096
along with their corresponding exception stack trace.
at com.sun.imageio.plugins.gif.GIFImageReader.read(GIFImageReader.java:984)
at javax.imageio.ImageReader.read(ImageReader.java:939) - Remember that after restarting the server you must enable the mentioned logs again.
-
After 2024.Q1.1, the relevant log class instead of
DLAMImageOptimizer
should becom.liferay.adaptive.media.image.optimizer.BaseAMImageOptimizer
.
Additional Information
- Some useful documentation to troubleshoot Adaptive Media issues are: