Hello
Im having problems displaying my images as thumbnails in a table. My code
for producing the new width and height from the original image is as follows
*************** *************** *************** *****
if ($ImagePath) {
//$Image = WEB_ROOT . 'images/PupilTester/' . $ImagePath;
$Image = 'images/PupilTester/' . $ImagePath;
} else {
$Image ='images/PupilTester/nopicture.bmp';
}
$size = getimagesize($i mage);
$height = $size[1];
$width = $size[0];
if ($height > 150)
{
$height = 150;
$percent = ($size[1] / $height);
$width = ($size[0] / $percent);
}
else if ($width > 150)
{
$width = 150;
$percent = ($size[0] / $width);
$height = ($size[1] / $percent);
}
//echo "<img src\"image/path/image.jpg\" height=\"$heigh t\"
width=\"$width\ " />";
*************** *************** *************** *************** **
and in my table to display the thumbnail I have
*************** *************** *************** *************** **
<td rowspan="5" valign="top"><d iv align="left"><i mg src=<?php echo $Image;
?> width= <?php echo "$width"?> height= <?php echo "$height"?> >
</div></td>
</tr>
*************** *************** *************** *************** ****
However the images are not showing at all. The cells of the table are blank.
But if I use
*************** *************** ***************
<td><img src=<?php echo $Image; ?>></td>
</tr>
*************** *************** *************
The images show full size as normal. Can anyone see where Ive gone wrong
Thaks
Ian
Im having problems displaying my images as thumbnails in a table. My code
for producing the new width and height from the original image is as follows
*************** *************** *************** *****
if ($ImagePath) {
//$Image = WEB_ROOT . 'images/PupilTester/' . $ImagePath;
$Image = 'images/PupilTester/' . $ImagePath;
} else {
$Image ='images/PupilTester/nopicture.bmp';
}
$size = getimagesize($i mage);
$height = $size[1];
$width = $size[0];
if ($height > 150)
{
$height = 150;
$percent = ($size[1] / $height);
$width = ($size[0] / $percent);
}
else if ($width > 150)
{
$width = 150;
$percent = ($size[0] / $width);
$height = ($size[1] / $percent);
}
//echo "<img src\"image/path/image.jpg\" height=\"$heigh t\"
width=\"$width\ " />";
*************** *************** *************** *************** **
and in my table to display the thumbnail I have
*************** *************** *************** *************** **
<td rowspan="5" valign="top"><d iv align="left"><i mg src=<?php echo $Image;
?> width= <?php echo "$width"?> height= <?php echo "$height"?> >
</div></td>
</tr>
*************** *************** *************** *************** ****
However the images are not showing at all. The cells of the table are blank.
But if I use
*************** *************** ***************
<td><img src=<?php echo $Image; ?>></td>
</tr>
*************** *************** *************
The images show full size as normal. Can anyone see where Ive gone wrong
Thaks
Ian
Comment