exif_thumbnail -- Retrieve the embedded thumbnail of a TIFF or JPEG image
Syntax
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.
Parameters
filename
The name of the image file being read. This image contains an
embedded thumbnail.
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.
Return Values
Returns the embedded thumbnail, or FALSE if the image contains no
thumbnail.
ChangeLog
Version
Syntax
4.3.0
The optional parameters width,
height, and imagetype
all became available.
4.3.0
May return thumbnails in the TIFF format.
Examples
Example 1. exif_thumbnail() example
<?php 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)); echo $image; exit; } else { // no thumbnail available, handle the error here echo 'No thumbnail available'; } ?>
exif thumbnail php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online
Php exif thumbnail syntax tutorial
php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.