pollora/mediaNew in 13.37
Your media library, on any disk.
Sizes declared in PHP. Files stored on S3, R2 or whatever Laravel can reach. WordPress never notices.
01 Declare and sign
Say which sizes you use. Not how to make them.
The URL, the width, the height and the srcset are worked out from the image’s metadata, and rendering a page never touches the disk. The file name carries an HMAC of the original and of the size: change a size, the name changes, and no cache ever holds an old file.
ImageSize::add('card')->cover(600, 400)->webp(75);
ImageSize::add('hero')
->scale(width: 1920)->webp(70)
->widths([640, 1024, 1440]);
ImageSize::add('thumb')->cover(150, 150)->eager(); WebP by default, AVIF with ->avif(). GD and Imagick write WebP; AVIF depends on the server.