我们如何在DAM AEM6.3中压缩图像? [英] How can we compress images in DAM AEM6.3?

查看:143
本文介绍了我们如何在DAM AEM6.3中压缩图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试提高我们网站的页面得分(google).一种选择是"图像优化".

We are trying to increase the page score (google) for our website. One of the options to do this is "Image optimization".

由于DAM中有大量图像,我们如何压缩/优化它们? AEM是否有任何这样的工具来实现这一目标?

As we have a huge number of images in the DAM, how can we compress/optimize them? Does AEM have any such tool to achieve this?

ImageMagick 是实现此目的的工具之一.我们是否需要将其与AEM集成,或者在使用该工具压缩图像后必须重新上传所有图像?

ImageMagick is one of the tool to achieve this. Do we need to integrate that with AEM or we'll have to re-upload all the images after compressing them using the tool?

有什么建议吗?

推荐答案

与CSS,JS和HTML文件相比,它们可以是

In contrast to CSS, JS and HTML files which can be gzipped using dispatcher, images can be compressed only by reducing quality or resizing them.

对于AEM项目,这是很常见的情况,有两种选择可以做到这一点,其中有些是开箱即用的,甚至不需要编程:

It is a quite common case for AEM projects and there are a couple of options to do that, some of them are coming out-of-the-box and do not even require programming:

  • You can extend DAM Update Asset with CreateWebEnabledImageProcess Workflow Process Step. It allows you to generate new image rendition with parameters like size, quality, mime-type. Depending on workflow launcher configuration, this rendition can be generated during creation or modification of assets. You can also trigger the workflow to be run on chosen or all assets.

如果CreateWebEnabledImageProcess配置不足以满足您的要求,则可以使用例如

In case that CreateWebEnabledImageProcess configuration is not sufficient for your requirements, you can implement your own Workflow Process Step and generate proper rendition programmatically, using for example ImageHelper or some Java framework for images transformation. That might be also needed if you want to generate the compressed images on the fly, for example, instead of generating rendition for each uploaded image, you can implement servlet attached to proper selectors and image extensions (i.e. imageName.mobile.png) which return the compressed image.

最终,可以与ImageMagick集成

Eventually, integration with ImageMagick is possible, Adobe documentation describes how it can be achieved using CommandLineProcess Workflow Process Step. However, you need to be aware of security vulnerabilities related to this mentioned in the documentation.

还值得一提的是,如果您的客户将来需要更高级的图像转换解决方案,那么

It is also worth to mention that if your client needs more advanced solutions for images transformation in the future, then integration with Dynamic Media can also be considered as a possibility, however, this is the most costly solution.

这篇关于我们如何在DAM AEM6.3中压缩图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆