PHP獲取Exif縮略圖的方法
更新時間:2015年07月13日 15:01:59 作者:不吃皮蛋
這篇文章主要介紹了PHP獲取Exif縮略圖的方法,實(shí)例分析了php針對圖片的讀取及返回MIME類型的相關(guān)技巧,具有一定參考借鑒價值,需要的朋友可以參考下
本文實(shí)例講述了PHP獲取Exif縮略圖的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
// file to read
$file = 'test.jpg';
$image = exif_thumbnail($file, $width, $height, $type);
// width, height and type get filled with data
// after calling "exif_thumbnail"
if ($image) {
// send header and image data to the browser:
header('Content-type: ' .image_type_to_mime_type($type));
print $image;
}
else {
// there is no thumbnail available, handle the error:
print 'No thumbnail available';
}
希望本文所述對大家的php程序設(shè)計有所幫助。
相關(guān)文章
php中將數(shù)組存到文件里的實(shí)現(xiàn)代碼
php的數(shù)組十分強(qiáng)大,有些數(shù)據(jù)不存入數(shù)據(jù)庫直接寫到文件上,用的時候直接require2012-01-01

