Skip to content

FallbackImageUrl

Sets an image that is served when the source cannot be loaded.

imgproxy: fallback_image_url (alias fiu) · Availability: imgproxy Pro only

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

The option appears in the URL as fiu:aHR0cHM6Ly9leGFtcGxlLmNvbS9mYWxsYmFjay5qcGc.

Parameter Type Default Description
$url string required The URL of the fallback image, without any encoding.
  • The library Base64-encodes the URL.

imgproxy reference