Interface AMImageScaler


public interface AMImageScaler
Scales an image to fit the characteristics specified by the image configuration entry.

This interface should be implemented to let Adaptive Media work with new image types that are supported by the out-of-the-box image scalers, or to replace one of the existing image scalers.

Implementations of this interface must be registed as OSGi components. The mime.type property defines the MIME type(s) that the image scaler can handle. The special MIME type * is used as a fallback in case there's no image scaler for a specific MIME type.

Image scalers can be replaced by registering an OSGi component with a higher service.ranking property.

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns true if the image scaler is enabled to scale images.
    scaleImage(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, AMImageConfigurationEntry amImageConfigurationEntry)
    Generates a scaled image for the file version that fits the characteristics specified by the image configuration entry.
  • Method Details

    • isEnabled

      default boolean isEnabled()
      Returns true if the image scaler is enabled to scale images.
      Returns:
      true if the image scaler is enabled to scale images
    • scaleImage

      AMImageScaledImage scaleImage(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, AMImageConfigurationEntry amImageConfigurationEntry)
      Generates a scaled image for the file version that fits the characteristics specified by the image configuration entry.
      Parameters:
      fileVersion - the file version of the image to scale
      amImageConfigurationEntry - the image configuration entry
      Returns:
      the scaled image