Rechercher une fonction PHP

exif_thumbnail

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

exif_thumbnailRetrieve the embedded thumbnail of an image

Description

exif_thumbnail ( mixed $stream [, int &$width [, int &$height [, int &$imagetype ]]] ) : string

exif_thumbnail() reads the embedded thumbnail of an 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.

PHP: exif_thumbnail - Manual Home of Manuel PHP  Contents Haut

Parameters

stream

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.

imagetype

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

PHP: exif_thumbnail - Manual Home of Manuel PHP  Contents Haut

Return Values

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

PHP: exif_thumbnail - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 exif_thumbnail() 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';
}
?>

PHP: exif_thumbnail - Manual Home of Manuel PHP  Contents Haut

Changelog

Version Description
7.2.0 The filename parameter was renamed to stream and now supports both local files or stream resources.

PHP: exif_thumbnail - Manual Home of Manuel PHP  Contents Haut

Notes

Note:

If the stream 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.

PHP: exif_thumbnail - Manual Home of Manuel PHP  Contents Haut

See Also

Find a PHP function

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-exif-thumbnail.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : http://php.net

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut