TransWikia.com

Is there a way to add custom aspect ratios in the image editor?

Craft CMS Asked on August 6, 2020

We’d like to add a custom aspect ratio to the list of aspect aspect ratios in the image editor so our client doesn’t have to look it up to remember each time. Is this possible?

enter image description here

One Answer

This will be possible using a new imageEditorRatios config setting that is coming in Craft 3.5 (due to release in early August 2020):

...
'imageEditorRatios' => [
    'Unconstrained' => 'none',
    'Original' => 'original',
    'Square' => 1,
    '16:9' => 1.78,
    '10:8' => 1.25,
    '7:5' => 1.4,
    '4:3' => 1.33,
    '5:3' => 1.67,
    '3:2' => 1.5,
    'Some custom ratio' => 1.9,
];

Source (GitHub issue)

Correct answer by Mats Mikkel Rummelhoff on August 6, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP