Image Scaling in Liferay

Have you ever wondered if Liferay offer image scaling out of the box? Yes it does, you only need to enable this option!

In add:

The second property image.hook.impl sets the hook implementation to be used to trigger automatic data migration during an upgrade.

Requesting Scaled Images

Now in order to request scaled images simply use height and width as GET parameters, like so:



For performance reasons Liferay caches scaled images. Please refer to ImageUtil API for more information.

Further Readings

Further information can be obtained by consulting the Image section in the Liferay Portal 6.1 – User Guide.

2 thoughts on “Image Scaling in Liferay”

  1. It looks like the JPEG compression ratio is set to a very low value. The resulting image quality is horrible. Is there a way to set this?

  2. The endpoint doesn’t seem to be protected in any way. An attacker could fill the server hard drive by just requesting lots of different large versions of an image.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top