exif_thumbnail
exif_thumbnail
Retrieve the embedded thumbnail of an image
**exif_thumbnail** $file int $width int $height int $image_type
reads the embedded thumbnail of an image.
exif_thumbnail
If you want to deliver thumbnails through this function, you should send
the mimetype information using the function.
header
It is possible that cannot create an
image but can determine its size. In this case, the return value is
false but and
are set.
exif_thumbnail``width``height
file
The location of the image file. This can either be a path to the file
or a stream .
resource
widthThe return width of the returned thumbnail.
heightThe returned height of the returned thumbnail.
image_typeThe returned image type of the returned thumbnail. This is either
or .
Returns the embedded thumbnail, or false if the image contains no thumbnail.
Voorbeeld: example
<?php
$image = exif_thumbnail('/path/to/image.jpg', $width, $height, $type);
if ($image!==false) {
header('Content-type: ' .image_type_to_mime_type($type));
echo $image;
exit;
} else {
// no thumbnail available, handle the error here
echo 'No thumbnail available';
}
?>
Opmerking: > If the is used to pass a stream to this function, then the stream must be seekable. Note that the file pointer position is not changed after this function returns.
file
exif_read_data``image_type_to_mime_type