Forum Moderators: coopster
I am trying to implement "Thumbnails in PHP by Michael Bailey" into my own code and I can't make a thumbnail. I get the "broken image" image and when I right click on it to view image I keep getting this error :
Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\clickreturn\Thumbs.php:8) in c:\inetpub\wwwroot\clickreturn\Thumbs.php on line 85
The error occurs on the line in Thumbs (Michael's code) that says
header("Content-type: image/jpeg");
It's also followed by garbage that looks like this :
ÿØÿàÿþCREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality
plus a bunch of other junk
Michael's code can be found in the link above and my code that calls it looks like this :
printf("<tr>
<td><input type=\"checkbox\" name=\"checkbox".$myrow['MapID']."\" value=\"checkbox\"></td>\n
<td><a href=%s?Map=%s&MapID=%s&Lat=%s&Lon=%s><img src=\"Thumbs.php?Maps/%s\" border=\"0\"></a></td>\n
<td>%s<center><a href=%s?Map=%s&MapID=%s&Lat=%s&Lon=%s>%s</center></font></td>\n
<td><center>%s%s</center></font></td>\n
<td><center>%s%s</center></font></td>\n
</tr>",
$_SERVER['PHP_SELF'], $KW, $myrow["MapID"], $Lat, $Lon, $myrow["MapFilename"],
$fontset, $_SERVER['PHP_SELF'], $KW, $myrow["MapID"], $Lat, $Lon, $myrow["Keywords"],
$fontset, $myrow["Latitude"],
$fontset, $myrow["Longitude"]);
Thanks in advance for anyone that can help me make thumbnails on the fly
[edited by: jatar_k at 7:42 pm (utc) on June 16, 2004]
[edit reason] delinked [/edit]
The script receives one parameter which corresponds to the relative path of the full-size image. This address is to be placed as the src field of an image tag. An example image tag might look like this:<img src="/thumbnail.php?dir/image.png">.
- sharyn
[edited by: jatar_k at 7:41 pm (utc) on June 16, 2004]
[edit reason] removed url [/edit]