At 20:38 22.06.2002, Marcus Börger wrote:
>helly           Sat Jun 22 14:38:34 2002 EDT
>
>   Modified files:
>     /php4/ext/exif      exif.c
>   Log:
>   @exif_read_data returns mime-type now for image and thumbnail And 
> exif_thumbnail now optionally returns imagetype. (Marcus)
>   #So now you can use imagetype2filetype with exif_thumbnail
>
>Index: php4/ext/exif/exif.c
>diff -u php4/ext/exif/exif.c:1.92 php4/ext/exif/exif.c:1.93

(...)

This allows the following script:

<?php

// expect $imagefile contains path&filename for an image.
$width     = 0;
$height    = 0;
$image_type= 0;
$thumbnail = @exif_thumbnail($imagefile, $width, $height, $image_type);

if ($thumbnail===false)
{
         // generate and catch or get cached thumbnail
         // return cached thumbnail
         exit;
}
else
{
         // Return content-type of thumbnail
         @Header("content-type: ".imagetype2mimetype($image_type));
         // and thumbnail itself
         echo($thumbnail);
         exit;
}

?>

Question:

if i use
$width=$height=$image_type=0;
then all three receive the value of $image_type. Where is the failure?

Reply via email to