eZ Community » Blogs » Core Development team » New in eZ 5.4: Image alias system...

By

New in eZ 5.4: Image alias system revamped

Thursday 06 November 2014 10:45:04 am

  • Currently 3 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Image alias system can be considered as one of the oldest features in eZ Publish. It is a very flexible mechanism for managing content images and has long proven its efficiency. 

But the system was left as is when we switched to version 5, and was still running through the legacy kernel until now. As part of our legacy code clean-up in eZ kernel, the image alias system has been redesigned, in a much more modern way...

No functional change

From the end-developer perspective, nothing has changed. One can still use ez_image_alias() Twig function (indirectly called by ezimage rendering using ez_render_field()) in templates, and previously written code won't break. What has really changed is the new AliasGenerator which is using features from LiipImagineBundle under the hood, instead of delegating everything to the legacy kernel. And given we always consider BC, there is of course no change in legacy stack (i.e. legacy templates).

Introducing LiipImagineBundle

LiipImagineBundle is a nice Symfony bundle which comes on top of Imagine library. It supports GD (default), ImageMagick (through Imagick PHP extension) and GraphicsMagick (through Gmagick PHP extension). The major difference with versions prior to 5.4 / 2014.11 is that the convert binary is not used any more when using ImageMagick / GraphicsMagick.

So what, will you wonder... Actually the best part is that it is now even easier and more flexible to implement custom filters for your aliases, as you can implement them in PHP! Using the Imagine API directly, you will be able to use effects, filters and all kind of fancy stuff in a much more flexible way

Backwards compatibility

Most of the legacy filters will continue to work, except a few that are mostly obsolete or simply incompatible

If you were using ImageMagick before, ensure you have installed Imagick PHP extension. You can then update your configuration to specify the correct driver to use:

# ezpublish.yml or config.yml
liip_imagine:
    # Driver can either "imagick", "gmagick" or "gd" (default)
    # depending on the PHP extension you're using.
    driver: imagick

More info

Proudly Developed with from