Option to padding image background on bestFit method #322
Replies: 3 comments
-
While this is possible with the current API, it takes a few extra steps. I'm open to a new option (or method) that makes this easier, similar to what we're doing with The $image->bestFit(800, 600, [
// When true, the resulting image will be the exact dimensions specified.
// Pixels that would normally be trimmed will be transparent by default,
// but can be changed with the `fill` option.
'exact' => true,
/* The fill color to use when `exact` is enabled. */
'fill' => '#fff'
]); When
How does that sound? |
Beta Was this translation helpful? Give feedback.
-
Is this something we can do now? or is this something in the works. I'm trying to make a thumbnail with a white background and rounded corners. If we can't do this now... what would it look like to take a logo, and add a white background with rounded corners? How would I code that properly using SimpleImage? Thanks :) |
Beta Was this translation helpful? Give feedback.
-
I added these two methods in myImageClass to padding image with specified color:
|
Beta Was this translation helpful? Give feedback.
-
When a set of images are produced using bestFit method, their size will be irregular and different. It would be better if there was an option for padding that would make all images the same size and cover the empty space with the selected color.
->bestFit(800, 600, '#ffffff')
Beta Was this translation helpful? Give feedback.
All reactions