玉兰图像变化设置裁剪位置

Magnolia image variation set the crop position

在 Magnolia 中,我认为如果将裁剪设置为 true,则裁剪位置默认为中心。例如。平均裁剪顶部和底部。但是,我想创建一个仅从顶部或底部(或从左/右)裁剪的版本。这在 Wordpress 中很容易做到,但我找不到 Magnolia 的任何文档。

相关链接

https://documentation.magnolia-cms.com/display/DOCS57/How+to+work+with+images+using+imgfn https://documentation.magnolia-cms.com/display/DOCS53/Imaging+module

在 google 个群组中找到这个

https://groups.google.com/a/magnolia-cms.com/forum/#!searchin/dev-list/crop%7Csort:date/dev-list/duMR1ePQHEk/lJK4_d-1AwAJ

Hey guys,

Currently the magnolia imaging module cropping and resizing is working very nicely for us. I'm implementing responsive images, but would like responsive header images as well (which means I want to set a focal point on the images) --> for example; focus on top right and then crop image accordingly.

What JAVA class would I have to change to edit the standard behaviour of the cropping focussing on the center of the image?

I already looked into this java operation: [url]https://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/modules/magnolia-imaging/3.1.4/apidocs/info/magnolia/imaging/operations/cropresize/AutoCropAndResize.html#getEffectiveTargetSize(java.awt.image.BufferedImage, info.magnolia.imaging.operations.cropresize.Coords, info.magnolia.imaging.ParameterProvider)[/url]

我在寻找有关 Magnolia 的 Focal Point 扩展的主题时偶然发现了这一点,它应该完全符合您计划自己实施的内容。

也许这会对您有所帮助:https://wiki.magnolia-cms.com/display/EX/Focal+Points#FocalPoints-Installation

除此之外,执行调整大小的默认 class 是

info.magnolia.templating.imaging.variation.SimpleResizeVariation

Magnolia 文档中简要提到了这一点

https://documentation.magnolia-cms.com/display/DEV/Scaled+image+quality?focusedCommentId=82122990#comment-82122990