if (file_exists($path)) {
$fileContent = id3_getImage($path);
$fileMime = id3_getMimeOfImage($path); // is set to image/jpeg
if ($fileMime != "") {
header('Content-Type: '.$fileMime);
print($fileContent);
die;
}
}
所以上面的代碼在瀏覽器不能正常工作,但是當我做一個圖像與圖像PHP輸出圖像發出
$img = imagecreatefromstring($fileContent);
imagejpeg($img, 'test.jpg');die;
創建映像,我可以看到它在我的電腦上。所以,我不知道我在做什麼錯:(
*難道是在Apache的conf設置?說實話,我在這一個
我需要動態創建的圖像讀取時這一個是爲我工作,所以它不是真正創建圖像,然後將其重定向到路徑的選項。無論如何,它應該這樣工作,雖然 – 2012-04-21 20:30:24
只是使用'imagejpeg($ img,NULL);' – smocking 2012-04-21 20:30:48
請解釋id3_getImage()和id3_getMimeOfImage() - 這些不是有效的運算符。 – 2012-04-21 20:41:29