Skip to content

MaxAnimationFrames

Limits the number of frames of animated sources. It overrides the imgproxy configuration.

imgproxy: max_animation_frames (alias maf) · Availability: all editions

use SomehowDigital\ImgProxy\Url;
use SomehowDigital\ImgProxy\Option\MaxAnimationFrames;
$url = Url::create()
->source('https://example.com/image.jpg')
->options(new MaxAnimationFrames(10));
$url->build();
// _/maf:10/plain/https%3A%2F%2Fexample.com%2Fimage.jpg

The option appears in the URL as maf:10.

Parameter Type Default Description
$frames int required Maximum number of frames, at least 1.
  • Values below 1 throw an InvalidArgumentException.
  • imgproxy only honors this option when IMGPROXY_ALLOW_SECURITY_OPTIONS is enabled.

imgproxy reference