Skip to content

Kirby 4.5.0

$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

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.