crop outside the image size

Created on 7 March 2018, almost 7 years ago
Updated 15 August 2023, over 1 year ago

It could be nice to be able to crop outside the image.
For exemple, for a 75x75 crop and an original image of 100x50.
The only solution is to open the image in an editor to add 25 px to the height of the image; then go back to drupal to be able to crop it.

Note that there are many other use cases less easy to explain by words.

We need a color/alpha selector to select the colors of the pixels to be added around the images.

To summarize:
1-In the crop type definition, we need to add an option like: enlarge the image if it not fits @value. "@value" coul be a fixed size or a ratio
2-In the crop type definition, we could add an option like: default color of the added pixel around the image [or it could be the left bottom pixel]
3-In the crop widget, if "enlarge..." option is selected, then we need to add a selector to override the efault color of the added pixels.

✨ Feature request
Status

Active

Version

2.0

Component

User interface

Created by

πŸ‡§πŸ‡ͺBelgium DuneBL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    I did something similar as above, but added a second flexible crop option. Now I have a 16:9 crop for images with enough pixels, a manual crop that can cut out part to letterbox, and no crop (reset crop) to use the full image. This is working for images that are tall enough, but not as wide as the aspect ratio.

    1. Manual crop (default crop, no settings)
    2. 16:9 crop (fixed aspect ratio, 1600x900 soft limit)
    3. Scale height 900
    4. Set canvas 1600x900

    Scaling the height shrinks it to fit the canvas size, but won't work if you crop the image too wide. Use the 16:9 crop for that instead.

    Is it possible to not apply the crop by default? In many cases it's probably not wanted when using this effect.

Production build 0.71.5 2024