Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Support for resize or thumb #39

Closed
mhuegel opened this issue Nov 28, 2018 · 4 comments
Closed

Support for resize or thumb #39

mhuegel opened this issue Nov 28, 2018 · 4 comments

Comments

@mhuegel
Copy link

mhuegel commented Nov 28, 2018

Whats your approach when it comes to resizing images? Kirbys resize and thumb functions don't seem to work?

@fvsch
Copy link
Owner

fvsch commented Nov 28, 2018

I would probably use the thumb method on the image object directly:

$someImage->thumb(...);

You can also expose any PHP function to the Twig environment:
https://github.com/fvsch/kirby-twig/blob/main/doc/functions.md

@mhuegel
Copy link
Author

mhuegel commented Feb 13, 2019

This works for me:

  • {{ image.toFile.crop('100', '100') | raw }}

but how do i call the thumb-method with multiple options?

@fvsch
Copy link
Owner

fvsch commented Feb 13, 2019

Something like this?

{{ image.thumb({
  width: 300,
  height: 200,
  quality: 80
}).html() }}

@mhuegel
Copy link
Author

mhuegel commented Feb 13, 2019

Awesome, thank you!

@mhuegel mhuegel closed this as completed Feb 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants