@@ -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
345344Available 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
354358See the [ Image Storage and Versioning] ( Image-Storage-And-Versioning.md ) documentation for more details.
355359
0 commit comments