Iam無法在網頁中顯示jp2圖像。從mysql數據庫獲取jp2圖像並使用php顯示在網頁中
這是從數據庫中獲取圖像並將其顯示到網頁中的主要文件。
數據庫中的圖像格式爲JP2圖像格式。
<?php
echo' <html>';
echo'<body>';
echo' <table>';
echo' <tr><td>';
$dbcnx = @mysql_connect('127.0.0.1', 'root', '[email protected]');
if (!$dbcnx) {
die('<p>Unable to connect to the ' . 'database server at this time.</p>'
);
}
if ([email protected]_select_db('finaldb')) {
die('<p>Unable to locate the ' . 'database at this time.</p>');
}
$selectrc = 'select BPFT_Photo from photo_templates limit 1';
$result = @mysql_query($selectrc, $dbcnx);
if (!$result) {
die('<p>Error performing query: ' . mysql_error() . '</p>');
} else {
}
$n = mysql_num_rows($result);
$row = mysql_fetch_assoc($result);
$Photo_Details = $row['BPFT_Photo'];
$residentPhoto = getResidentPhoto();
$image_type_to_mime_type0 =image_type_to_mime_type($residentPhoto)
header('Content-type:$image_type_to_mime_type0');
echo' '.$residentPhoto;
echo'</td>';
echo'</tr>';
echo'</table>';
echo'</body>';
echo'</html>';
?>