Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

exif_thumbnail

Description

The exif_thumbnail of Exif for PHP retrieves the embedded thumbnail of an image.

Syntax

exif_thumbnail(
    resource|string $file,
    int &$width = null,
    int &$height = null,
    int &$image_type = null
): string|false

Parameters

file

The location of the image file. This can either be a path to the file or a stream resource.

width

The return width of the returned thumbnail.

height

The returned height of the returned thumbnail.

image_type

The returned image type of the returned thumbnail. This is either TIFF or JPEG.

Return

Returns the embedded thumbnail, or false if the image contains no thumbnail.

Examples

1 · file

<?

$file = $_SERVER["DOCUMENT_ROOT"] . "/assets/jpg/1.jpg";

$return = exif_thumbnail($file);

var_export($return);

?>
false

2 · width height image_type

<?

$file = $_SERVER["DOCUMENT_ROOT"] . "/assets/jpg/1.jpg";

$return = exif_thumbnail($file, $width, $height, $image_type);

var_dump($return, $width, $height, $image_type);

?>
bool(false)
NULL
NULL
NULL
HomeMenu