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 TypeMethodDescriptiondefault booleanReturnstrueif 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()Returnstrueif the image scaler is enabled to scale images.- Returns:
trueif 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 scaleamImageConfigurationEntry- the image configuration entry- Returns:
- the scaled image
-