Enabling Optimization of Animated GIFs

To scale animated GIFs, Adaptive Media uses an external tool called Gifsicle.

If Gifsicle isn’t installed and image/gif is included as a supported MIME type, Adaptive Media scales only one frame of the GIF, making a static GIF.

Optimizing animated GIFs using Adaptive Media requires three steps: installing Gifsicle on your local server where DXP is running, setting the PATH environment variable, and then enabling Gifsicle in DXP’s System Settings.

  1. Install Gifsicle and add it to the server’s PATH environment variable.

    Note

    As of Liferay DXP 2025.Q3, Gifsicle is no longer preinstalled in Liferay Docker images. To install it manually,

    1. Run the container as the root user:
    docker exec -u root -it <container_name_or_id> bash
    
    1. Inside the container, install Gifsicle:
    apt-get update && apt-get install -y gifsicle
    

    After installation, ensure the container’s PATH environment variable includes the path to gifsicle.

  2. Configure Adaptive Media:

    1. Navigate to the Global Menu, select the Control Panel tab, and click System SettingsAdaptive Media.

      Access the Adaptive Media system settings.

    2. Under Images, check Gifsicle Enabled.

      Enable Gifsicle.

  3. Additional Steps:

    • If ImageMagick is set to handle image/gif, GIFs may not display correctly. To prevent conflicts, select ImageMagick in the left menu and click Remove Setting (Remove icon) next to image/gif under Supported MIME Types to ensure Gifsicle handles optimization.

      Remove image/gif from ImageMagick's Supported MIME Types to prevent conflicts with Gifsicle.

    • If Adaptive Media is disabled, previews and thumbnails are not displayed in Documents and Media. Ensure at least one Adaptive Media setting is enabled.

      Enable at least one Adaptive Media setting to display GIF previews and thumbnails.

  4. Click Save when finished.