|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28535 exif_thumbnail not working correctly
Submitted: 2004-05-26 21:40 UTC Modified: 2005-02-01 23:10 UTC
From: itch74 at hotmail dot com Assigned:
Status: Not a bug Package: EXIF related
PHP Version: 4.3.4 OS: Win 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: itch74 at hotmail dot com
New email:
PHP Version: OS:


 [2004-05-26 21:40 UTC] itch74 at hotmail dot com
While exif_thumbnail function works its practical use seems limited.

Using php 4.3.4 and the latest apache 2.0 build (5/04) the thumbnail of an image will not be
displayed correctly unless some unknown circumstance exists.  For example:  if you use the

 $image = exif_thumbnail('griffon1.jpg');
  header("Content-type: image/jpeg");
  echo $image;

This will work however, if you use this following script (1 php file):

// test

 $image = exif_thumbnail('griffon1.jpg');
 header("Content-type: image/jpeg");
 echo $image;

You will receive this error: 
Warning: Cannot modify header information - headers already sent by (output started at
C:\apache\Apache2\htdocs\index2.php:5) in C:\apache\Apache2\htdocs\index2.php on line 7

followed by raw image data, not the image itself.

I have also tried using ob_start and ob_flush at the
beginning and ending of the page.. .this will remove the warning, but you will not see the image, only the raw image data.

Reproduce code:
// test

 $image = exif_thumbnail('griffon1.jpg');
 header("Content-type: image/jpeg");
 echo $image;

Expected result:
Viewing the thumbnail of an image.

Actual result:
Raw image data output, no picture.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-26 21:43 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The space between ?> and <?php gets sent and consequently 
prevents you from sending the header in 2nd php bit. 
 [2014-04-03 09:05 UTC] ravime_Arvici at yahoo dot com
it's fault of utf-8 signature (bom) file starts output of bom and when you are setting hader  headers are allready sent to browser and can't be modified

remove any whitespace and bom from your file.

dream, file save as > unicode options  unckeck include unicode signature (bom)
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jun 30 14:03:37 2022 UTC