ThumborProvider
ThumborProvider
Generates Thumbor transformation URLs. Self-hosted, open-source image processing server.
use Timber\Chainsaw\Provider\Thumbor\ThumborProvider;
use Timber\Chainsaw\Signer\Algorithm;
use Timber\Chainsaw\Signer\HmacUrlSigner;
$provider = new ThumborProvider(
host: 'http://localhost:8084',
signer: new HmacUrlSigner(key: 'thumbor-secret', algorithm: Algorithm::Sha1), // optional
);
Output: {host}/{signature|unsafe}/{manualCrop}/{fitIn}/{w}x{h}/{align}/{smart}/filters:{filters}/{source}
Thumbor signing is HMAC-SHA1 by default (the libthumbor reference). Pass algorithm: Algorithm::Sha256 if your Thumbor instance is configured for it.
Manipulation support
Legend: β = implemented in Chainsaw, β οΈ = supported with caveats, π¦ = available on the CDN, not exposed by Chainsaw, β = not available on this CDN.
Resize & crop
| Manipulation | Chainsaw | Availability |
|---|---|---|
| Width | β | Free |
| Height | β | Free |
| Scale | β | No scale-by-factor primitive; use width()/height() |
| Cover | β | Free (crop() alias; compass / smart anchors β focal() throws, Thumbor needs a rectangle not a point) |
| ManualCrop | β | Free |
| Contain | β | Free |
| Pad | β | Free |
| Stretch | β | Free (via stretch() filter) |
| CropToRatio | β | No aspect-ratio-only crop; use cover() with absolute dims |
| PadToRatio | β | No aspect-ratio-only pad; use pad() with absolute dims |
| Proportion | π¦ | Free (scale by percentage) |
| Smart crop | π¦ | Free (content-aware/face detection) |
| Trim | β | Free |
| Extract focal points | π¦ | Free (return focal point data) |
Filters & effects
| Manipulation | Chainsaw | Availability |
|---|---|---|
| Blur | β | Free |
| Sharpen | β | Free |
| Brightness | β | Free |
| Contrast | β | Free |
| Gamma | β | |
| Greyscale | β | Free |
| Sepia | β | |
| Pixelate | β | |
| Saturation | β | Free |
| Hue | β | |
| Negate | β | |
| Equalize | π¦ | Free (histogram equalization) |
| Noise | π¦ | Free |
| Convolution | π¦ | Free (custom kernel) |
| RGB channels | π¦ | Free (per-channel adjustment) |
| Red-eye removal | π¦ | Free |
Decoration & orientation
| Manipulation | Chainsaw | Availability |
|---|---|---|
| Background | β | Free |
| Border | β | Not available β no canvas-expanding border primitive |
| Flip | β | Free |
| Rotate | β οΈ | Free; 90/180/270 only β arbitrary angles throw UnsupportedManipulator |
| AutoOrient | β | Free; no-op at URL level (EXIF auto-orient is controlled server-side via RESPECT_ORIENTATION) |
| Watermark | β | Free |
| Round corners | π¦ | Free (radius + background color) |
Special
| Manipulation | Chainsaw | Availability |
|---|---|---|
| BlurHash | β | |
| ThumbHash | β | |
| Dither | β | |
| Strip EXIF | π¦ | Free |
| Strip ICC | π¦ | Free |
| Max bytes | π¦ | Free (auto quality degradation) |
| No upscale | π¦ | Free |
| Smart cover (native) | π¦ | Free (Thumborβs native cover thumbnail mode β distinct from the Cover resize manipulator above) |
| AutoJPG | π¦ | Free |
Encoding
| Format | Supported |
|---|---|
| JPEG | β |
| PNG | β |
| WebP | β |
| AVIF | β |
| GIF | β |
| Auto format | β |
| Quality | β |
Notes
- Gamma, Sepia, Pixelate, Hue, Negate, Border are not available in Thumbor β these manipulators throw
UnsupportedManipulator. - Cover β
cover()(and itscrop()alias) accepts compass and smart anchors.focal()throws: Thumbor expects a focal rectangle, not a point.Scale,CropToRatio, andPadToRatioare registered but throw at URL-build time (no scale-by-factor or aspect-ratio-only primitive); specify absolute dimensions viacover()/pad()instead. - Stretch β implemented as a Thumbor filter (
stretch()), not a path segment. - Sharpen β amount divided by 10, uses fixed radius 0.3 and luminance-only sharpening.
- Saturation β throws on
.gifsources: Thumborβssaturationfilter silently no-ops on animated GIFs. - Watermark β uses
watermark({url},{x},{y},{transparency},{w_ratio},{h_ratio})filter. Negative position values anchor from right/bottom edges. - Smart crop β Thumborβs signature feature. Uses content analysis and face detection to find the best crop region.
- AutoOrient β no-op at URL level; EXIF auto-orientation is controlled server-side via
RESPECT_ORIENTATION. - Auto format β
Format::Autois silently ignored (skipped inapplyEncoding); set an explicit format or compose a<picture>with typed sources. - HMAC signing β supported via path prefix.