Skip to content

Kirby 5.0.4

$file->isViewable()

Checks if a preview can be displayed for the file in the Panel or in the frontend

$file->isViewable(): bool

Return type

bool

This method modifies the existing $file object it is applied to and returns it again.

Parent class

Kirby\Filesystem\File

Viewable image types

By default, the following image formats can be shown in the file preview of the Panel:

  • avif
  • jpg
  • jpeg
  • gif
  • png
  • svg
  • webp

The viewable image types are defined in the Kirby\Image\Image class in the public static ::$viewableTypes property.