Scale by Orientation
Automatically scales images based on their orientation to create consistent sizes.
What it does
This image effect scales images to a target pixel size on their longest side:
- Landscape images (wider than tall): Scales width to your target size
- Portrait images (taller than wide): Scales height to your target size
- Square images: Treated as landscape, scales width
Perfect for galleries and grids where you want images to have similar visual weight. It works well with "set canvas" from Image Effects module
How to use it
- Go to Configuration → Media → Image styles
- Edit an image style (or create new)
- Click Add effect
- Choose Scale by Orientation
- Set your options:
- Target dimension: The pixel size (e.g., 200)
- Upscale images: Check to enlarge small images, uncheck to leave them as-is
Examples
With a 200px target dimension:
| Original | Result |
|---|---|
| 400×200 landscape | 200×100 |
| 200×400 portrait | 100×200 |
| 300×300 square | 200×200 |
Without upscaling: A 50×25 image stays 50×25
With upscaling: A 50×25 image becomes 200×100
Requirements
- Drupal 10 or 11
- Image module (core)
Supporting organizations:
Maintenance
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.1 site reports using this module
- Created by jsobiecki on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
