Exif Functions
PHP Manual


(PHP 4 >= 4.2.0, PHP 5, PHP 7)

exif_thumbnailRetrieve the embedded thumbnail of a TIFF or JPEG image


string exif_thumbnail ( string $filename [, int &$width [, int &$height [, int &$imagetype ]]] )

exif_thumbnail() reads the embedded thumbnail of a TIFF or JPEG image.

If you want to deliver thumbnails through this function, you should send the mimetype information using the header() function.

It is possible that exif_thumbnail() cannot create an image but can determine its size. In this case, the return value is FALSE but width and height are set.



The name of the image file being read. This image contains an embedded thumbnail.


The return width of the returned thumbnail.


The returned height of the returned thumbnail.


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

Return Values

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


Example #1 exif_thumbnail() example

if (array_key_exists('file'$_REQUEST)) {
$image exif_thumbnail($_REQUEST['file'], $width$height$type);
} else {
$image false;
if (
$image!==false) {
header('Content-type: ' .image_type_to_mime_type($type));
} else {
// no thumbnail available, handle the error here
echo 'No thumbnail available';

See Also

Exif Functions
PHP Manual