Home :: International :: Manuals :: Howto :: FAQ :: Man Pages :: Email Login

 
 

 

exif_thumbnail

(PHP 4 >= 4.2.0, PHP 5)

exif_thumbnail -- Retrieve the embedded thumbnail of a TIFF or JPEG image

Beschreibung

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.

The parameters width, height and imagetype are available since PHP 4.3.0 and return the size of the thumbnail as well as its type. 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.

Starting from version PHP 4.3.0, the function exif_thumbnail() can return thumbnails in TIFF format.

Rückgabewerte

If the image contains no thumbnail, FALSE will be returned. Otherwise the embedded thumbnail is returned.

Beispiele

Beispiel 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";
}
?>

 
 
 
 
Google
  Web Linuxinfor   
 

Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account

Document on this page is part of "PHP Handbuch". See Index Page for more info about Authorship and Copyright.

1999-2009 Linuxinfor.com. No rights reserved.