Add hooks for adding new image transform modes by plugins #8944
-
I was thinking of creating plugin that adds "letterbox" mode based on Imager functionality, but already existing transform modes (stretch, crop, fit) are pretty much hardcoded in source code of Craft. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Why is this mode not by default? Lol |
Beta Was this translation helpful? Give feedback.
-
@brandonkelly just to add on that issue. I dont think that it is really about letterbox mode specifically, but about adding possibility to implement any other various image transform modes that developers might want. Imager for example had three additional transform modes. So it would be nice if you reconsidered adding such event, as i think it wouldnt be hard thing to do, just modify |
Beta Was this translation helpful? Give feedback.
-
Since it was 3 years since last comment to this request, i would like to bump it again. One of my clients recently wanted to add some custom transform mode to his website which would detect uniform color background to the sides of image and crop it automatically. |
Beta Was this translation helpful? Give feedback.
-
We ended up adding a Letterbox transform mode in Craft 4.4.0. I’m going to close this now because we need to be mindful about what transform options can be added, since PHP (GD/ImageMagick) is not always the one doing the manipulations; sometimes it’s a third party service like Imgix or Craft Cloud. If there are additional modes/options you’d like added, feel free to request them individually, and we can consider those. |
Beta Was this translation helpful? Give feedback.
We ended up adding a Letterbox transform mode in Craft 4.4.0.
I’m going to close this now because we need to be mindful about what transform options can be added, since PHP (GD/ImageMagick) is not always the one doing the manipulations; sometimes it’s a third party service like Imgix or Craft Cloud.
If there are additional modes/options you’d like added, feel free to request them individually, and we can consider those.