downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<exif_tagnameread_exif_data>
Last updated: Thu, 26 Jun 2008

exif_thumbnail

(PHP 4 >= 4.2.0, PHP 5)

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

Description

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 Description
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';
}
?>



add a noteadd a note User Contributed Notes
Retrieve the embedded thumbnail of a TIFF or JPEG image
There are no user contributed notes for this page.




<exif_tagnameread_exif_data>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs