WordPress.org

Codex

Function Reference/file is displayable image

Contents

Description

file_is_displayable_image determines whether or not the file passed to it is a displayable JPG, GIF, or PNG image.

Usage

 <?php file_is_displayable_image($path); ?> 

Examples

Default Usage

<?php file_is_displayable_image(ABSPATH . "/image/a-picture.jpg"); ?>

Parameters

$path
(filesystem path) (required) The absolute path of the image you want to check.
Default: None