-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Letterboxing #3
Comments
Yeah, sure, that could be implemented. What do you think, would it make sense to use letterbox like this in the image configuration? 'custom-4-crop' => array(
// output should be 370, 370
'resize' => array( 370, 370 ),
// use letterbox with color #bada55
'letterbox' => '#bada55',
) When I’d use a parameter In addition to that, I also thought about using the 'custom-4-crop' => array(
'resize' => array( 240 ),
// convert to jpg with background #c0ffee when image is not a jpg
'tojpg' => '#c0ffee',
) When I’d use a parameter Of course you could also use both. In that case it would first convert the image to JPG and then letterbox it. Would it also make sense to use it with a twig filter? Like this: <img {{post.thumbnail|to_jpg|get_timber_image_responsive('header')}}> What do you think? I’ve never used any of the two filters before, so your opinion about how you could work with that would be nice ;). |
Sorry for not answering this before. We have a few hours difference. Your suggestions seem spot on I think. |
Since the issue has been closed, is this something planned for a future release? |
Huh? Why did I close that? Of course it’s not supposed to be closed! Thanks for the feedback. I’ll implement this in the next days. |
@gchtr Thanks Lukas. |
@lmartins Hey Luis. I added support for letterbox and tojpg filters in 08ac4f3. When you download the latest version, you should be good to go. |
@gchtr Hi Lukas, I can confirm it is now working. I couldn't get |
I didn’t implement the direct use of these filters in Twig yet. I’ll see what I can do. |
Ah ok. It is not essential in my use case, just a nice to have. |
Any plans to support the letterboxing cropping mode:
https://github.com/jarednova/timber/wiki/Image-cookbook#letterboxing-images
The text was updated successfully, but these errors were encountered: