Issue
- When trying to adapt media that were not automatically adapted using the "Adapt remaining" function, an error is shown in the UI and in the logs it may be possible to see the following error or warning:
2023-04-11 18:19:40.511 WARN [liferay/adaptivemediaprocessor-71][AMMessageListener:90] com.liferay.adaptive.media.exception.AMRuntimeException$IOException: Unable to scale file entry 26926280 to match adaptive media configuration Thumbnail-1024x1024
com.liferay.adaptive.media.exception.AMRuntimeException$IOException: Unable to scale file entry 26926280 to match adaptive media configuration Thumbnail-1024x1024
at com.liferay.adaptive.media.image.internal.scaler.AMDefaultImageScaler.scaleImage(AMDefaultImageScaler.java:71)
at com.liferay.adaptive.media.image.internal.processor.AMImageProcessorImpl.process(AMImageProcessorImpl.java:120)
at com.liferay.adaptive.media.image.internal.processor.AMImageProcessorImpl.process(AMImageProcessorImpl.java:75)
at com.liferay.adaptive.media.image.internal.processor.AMImageProcessorImpl.process(AMImageProcessorImpl.java:46)
at com.liferay.adaptive.media.web.internal.messaging.AMProcessorCommand$2.execute(AMProcessorCommand.java:43)
at com.liferay.adaptive.media.web.internal.messaging.AMMessageListener.doReceive(AMMessageListener.java:80)
at com.liferay.portal.kernel.messaging.BaseMessageListener.doReceive(BaseMessageListener.java:48)
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:34)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:56)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.liferay.portal.kernel.exception.ImageResolutionException: Image's dimensions of 1459 px high and 10338 px wide exceed max dimensions of 10000 px high and 10000 px wide
at com.liferay.adaptive.media.image.internal.util.RenderedImageUtil.readImage(RenderedImageUtil.java:85)
at com.liferay.adaptive.media.image.internal.processor.util.TiffOrientationTransformer.transform(TiffOrientationTransformer.java:57)
at com.liferay.adaptive.media.image.internal.scaler.AMDefaultImageScaler.scaleImage(AMDefaultImageScaler.java:51)
… 12 more
Environment
- Liferay DXP 7.1-7.4
Resolution
- For the case in question, it is necessary to perform the configuration in Liferay so that it works with images of the requested size, for this it is enough to insert the following property via portal-ext.properties:
# Set the maximum image height and width in pixels that can be read by the
# image tool. A value of 0 indicates no restrictions. See LPS-63358 for more
# information.
#
# Env: LIFERAY_IMAGE_PERIOD_TOOL_PERIOD_IMAGE_PERIOD_MAX_PERIOD_HEIGHT
# Env: LIFERAY_IMAGE_PERIOD_TOOL_PERIOD_IMAGE_PERIOD_MAX_PERIOD_WIDTH
# Default:
image.tool.image.max.height=10000
image.tool.image.max.width=10000
Additional Information
- The properties can be set to 0 so that there is no restriction or indicate the service sizes according to your needs. However, you must be careful when assigning a new value to it, as depending on your server's available memory, related errors may occur.
Contenido exclusivo para suscriptores.
Una Suscripción Enterprise de Liferay proporciona acceso a más de 1.500 artículos que incluyen las mejores practicas, diagnóstico de problemas y otras soluciones útiles. Inicia sesión para tener un acceso completo.
Inicia sesión