[Hippo-cms7-user] Improved Image Scaling in 7.7.1 with 'imgsclr'

Mathijs den Burger m.denburger at onehippo.com
Tue Apr 10 13:10:27 CEST 2012

On Tue, Apr 10, 2012 at 12:30 PM, Gerrit Berkouwer
<gerritberkouwer at gmail.com> wrote:
> In the 7.7.1 announcement I read this:
> ***
> Improved Image Scaling
> The quality of scaled images has been improved a lot through the usage of
> the open source imgscalr library. The original image data is used as-is
> whenever possible: image quality does not degrade when no scaling is needed.
> The image scaling process now is automatically throttled to protect and
> enhance the robustness of the CMS application itself.
> ***
> Nice. If it brings what I hope :-). Is there more info about the differences
> between 'imgsclr' and the old library?

The old scaling method used a multi-step technique to downscale
images, which was one of the best practices out there. The imgscalr
library also applies this technique when applicable, but also adds all
known Java image scaling tricks to improve quality and/or speed. See
[1] for a description of all the bells and whistles in there.

> The current image scaling in Hippo gives us no good results. Even when
> telling Hippo to not compress images at all, the resulting uploaded image
> was altered, in the wrong way, with bad results.

That's why we now keep the original image data as-is, whenever possible:
- when a variant is configured to keep the original dimensions (width
= 0 and height = 0)
- when the uploaded image already has the correct target dimension
- when the uploaded image should be scaled up, and upscaling is
disabled for that variant

Using the original data as-is will not lower the quality (obviously),
and also keep EXIF data (which may also be nice to have). Only when we
need to scale, we now process the incoming data with imgscalr and save
it back.

Note that this also makes it possible to, for example, fix scaled
variants manually when the automatically created variants are not
right for some reason (not the right quality, no EXIF data anymore,
transparent images that are not handles correctly, etc.). When you now
upload a new image for an individual variant, and the new image
already has the right width and height, we just use it as-is.


More information about the Hippo-cms7-user mailing list