Image Block Cropping and Image Ratio

Hey all

sorry about the maybe silly question but if i use the default image block and set cropping and ratio. There will be no effect in the frontend.

Is this right? I know i read about different stuff here but, what do you to get the images in right dimensions and crop out in the frontend? At the moment i just… do not see a best practice.

Thank you for your advices

That’s right. The image snippet only sets a data-ratio attribute but doesn’t do any cropping, resizing etc.

You can overwrite this snippet for your use case.

Ok i know i can overwrite the snippet but how i do it best way… i am not sure about that.

Maybe i have to precise my question. What is the best way to get the right ratio dimensions in the frontend. :upside_down_face:

Ok… maybe i really do not understand the concept but for image ratio settings i need the ratio in % right?

Value from Kirby is like 16/9 and not 56.25% which i need for calculating. That makes for me the ratio settings useless because i need to calculate it anyway from the actual image width and height.

am i wrong?

Right i am wrong… it is not completely useless. Now i did:

$ratioCalc = $ratio->split('/');
$actualRatio = $ratioCalc[1] / $ratioCalc[0] * 100;

this is giving me the right ratio in % what i need.