Issue
- When using Adaptive Media, the
tomcat/tempdirectory grows significantly, consuming a large amount of disk space. -
The following error can be seen repeatedly in the logs:
Unable to scale file entry <ID> to match adaptive media configuration <NAME>
Environment
- Liferay DXP 7.4 and Quarterly Releases.
- Adaptive Media and ImageMagick is enabled.
Resolution
- This issue occurs when Adaptive Media is configured to use ImageMagick for processing images, and there are GIF files in the Document and Media library.
- Each time a GIF is accessed, ImageMagick attempts to process it but fails, leaving behind temporary files (frames of the GIF) in the temp directory which are not automatically cleaned up.
Solution 1: Enable Gifsicle for Optimized GIF Previews
This is the recommended approach if animated GIF previews are desired.
- Install the Gifsicle tool on the server where Liferay is running.
- Enable Gifsicle in Liferay by navigating to Control Panel → Configuration → System Settings → Adaptive Media → Images.
- Check the Gifsicle Enabled box and save.
Solution 2: Disable ImageMagick for GIFs
This workaround will stop the errors and prevent the temp folder from filling up, but it will result in static previews for GIFs instead of animated ones.
- Navigate to Control Panel → Configuration → System Settings → Adaptive Media → ImageMagick
- In the Supported MIME Types field, remove the
image/gifentry. - Click Update to save the changes.
Additional Information