Skip to content

Commit 7219b76

Browse files
committed
Docs.
1 parent 96df105 commit 7219b76

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

docs/Documentation/How-To-Use.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,12 @@ $imageProcessor = new ImageProcessor($fileStorage, $pathBuilder, $imageManager);
314314
// Define variants
315315
$coverVariants = ImageVariantCollection::create();
316316
$coverVariants->addNew('thumbnail')
317-
->resize(150, 150)
318-
->optimize();
317+
->crop(150, 150);
319318
$coverVariants->addNew('medium')
320-
->resize(400, 400)
319+
->scale(400, 400)
321320
->optimize();
322321
$coverVariants->addNew('large')
323-
->fit(800, 600)
322+
->cover(800, 600)
324323
->optimize();
325324

326325
// Configure for your models
@@ -344,12 +343,17 @@ Configure::write('FileStorage.behaviorConfig', [
344343

345344
Available operations on variants:
346345

347-
- `resize(width, height)` - Resize maintaining aspect ratio
348-
- `fit(width, height)` - Resize and crop to exact dimensions
349-
- `crop(width, height, x, y)` - Crop specific area
350-
- `optimize()` - Optimize file size
351-
- `greyscale()` - Convert to grayscale
352-
- `blur(amount)` - Apply blur effect
346+
- `crop(width, height, x, y)` - Crop to exact dimensions at position (x, y optional)
347+
- `resize(width, height)` - Resize to exact dimensions (does not preserve aspect ratio)
348+
- `scale(width, height)` - Scale while preserving aspect ratio
349+
- `cover(width, height)` - Smart crop to cover exact dimensions
350+
- `widen(width)` - Resize by width, maintain aspect ratio
351+
- `heighten(height)` - Resize by height, maintain aspect ratio
352+
- `rotate(angle)` - Rotate by degrees
353+
- `flip(direction)` - Flip 'h' (horizontal) or 'v' (vertical)
354+
- `sharpen(amount)` - Apply sharpening
355+
- `optimize()` - Apply optimization if available on system
356+
- `callback(callable)` - Custom processing with callback function
353357

354358
See the [Image Storage and Versioning](Image-Storage-And-Versioning.md) documentation for more details.
355359

docs/Documentation/Image-Storage-And-Versioning.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,19 @@ This allows different variant configurations for different file types within the
6161

6262
### Available Variant Operations
6363

64-
- `resize(width, height)` - Resize maintaining aspect ratio
65-
- `fit(width, height)` - Resize and crop to exact dimensions
66-
- `crop(width, height, x, y)` - Crop specific area (x, y optional)
67-
- `optimize()` - Optimize file size
68-
- `greyscale()` - Convert to grayscale
69-
- `blur(amount)` - Apply blur effect
64+
- `crop(width, height, x, y)` - Crop to exact dimensions at position (x, y optional)
65+
- `resize(width, height)` - Resize to exact dimensions (does not preserve aspect ratio)
66+
- `scale(width, height)` - Scale while preserving aspect ratio
67+
- `cover(width, height)` - Smart crop to cover exact dimensions
68+
- `widen(width)` - Resize by width, maintain aspect ratio
69+
- `heighten(height)` - Resize by height, maintain aspect ratio
70+
- `rotate(angle)` - Rotate by degrees
71+
- `flip(direction)` - Flip 'h' (horizontal) or 'v' (vertical)
72+
- `flipHorizontal()` - Flip horizontally
73+
- `flipVertical()` - Flip vertically
74+
- `sharpen(amount)` - Apply sharpening
75+
- `optimize()` - Apply optimization if available on system
76+
- `callback(callable)` - Custom processing with callback function
7077

7178
### Array Configuration (Alternative)
7279

0 commit comments

Comments
 (0)