<?php
$filename = "test.jpg";
//$exif = exif_read_data ($filename,0,true); //有这个函数吗?
$exif = getimagesize($filename);
//print_r($exif);
echo "test.jpg:<br />\n";
echo "<img src='$filename' border=0 $exif[3]><br /><br />\n";
?>
$filename = "test.jpg";
//$exif = exif_read_data ($filename,0,true); //有这个函数吗?
$exif = getimagesize($filename);
//print_r($exif);
echo "test.jpg:<br />\n";
echo "<img src='$filename' border=0 $exif[3]><br /><br />\n";
?>
body{font-size:12px;font-family:tahoma}
</style>
<?php
$exif = exif_read_data ('test.jpg',0,true);echo "test.jpg:<br />\n";
echo "<img src=test.jpg border=0 width=400><br /><br />\n";
foreach($exif as $key=>$section) {
foreach($section as $name=>$val) {
echo "$name: $val<br />\n";
}
}
?>
下面的地址是运行后的截图,读出来的exif信息太多,实际我要用到的只是其中的部分。我想请教的就是如何读出这部分的EXIF信息。谢谢。http://club.phpe.net/uploads/post-2-1070936812.gif
2、把那张jpg图片打包后贴于www.dev-club.com 的php版面
它的EXIF信息为:相机厂商 FUJIFILM
相机型号 FinePix S602 ZOOM
软件 Adobe Photoshop 7.0
修改时间 2003-12-17 14:06:36
Exif 版本 V2.2
拍摄时间 2003-12-17 12:05:42
图片尺寸 525 x 700
压缩率 3 Bits/Pixel
曝光时间 1/100s
光圈 F 2.8
曝光模式 光圈优先
感光度 ISO 160
亮度 EV 4.08
曝光补偿 EV 0
最大光圈 F2.8
测光模式 多重
闪光灯 关 强制
焦距 11.6 mm
拍摄距离 微距
白平衡 日光白荧光 (D5700-7100K)
锐度 锐利
返回的是一个多维数组
Array
(
[FILE] => Array
(
[FileName] => post-1-1071641912.jpg
[FileDateTime] => 1071706598
[FileSize] => 116491
[FileType] => 2
[MimeType] => image/jpeg
[SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF
) [COMPUTED] => Array
(
[html] => width="525" height="700"
[Height] => 700
[Width] => 525
[IsColor] => 1
[ByteOrderMotorola] => 0
[CCDWidth] => 1mm
[ApertureFNumber] => f/2.8
[Copyright] =>
[Thumbnail.FileType] => 2
[Thumbnail.MimeType] => image/jpeg
) [IFD0] => Array
(
[Make] => FUJIFILM
[Model] => FinePix S602 ZOOM
[Orientation] => 1
[XResolution] => 72/1
[YResolution] => 72/1
[ResolutionUnit] => 2
[Software] => Adobe Photoshop 7.0
[DateTime] => 2003:12:17 14:06:36
[YCbCrPositioning] => 1
[Copyright] =>
[Exif_IFD_Pointer] => 236
) [THUMBNAIL] => Array
(
[Compression] => 6
[XResolution] => 72/1
[YResolution] => 72/1
[ResolutionUnit] => 2
[JPEGInterchangeFormat] => 874
[JPEGInterchangeFormatLength] => 4845
) [EXIF] => Array
(
[ExposureTime] => 10/1000
[FNumber] => 280/100
[ExposureProgram] => 3
[ISOSpeedRatings] => 160
[ExifVersion] => 0220
[DateTimeOriginal] => 2003:12:17 12:05:42
[DateTimeDigitized] => 2003:12:17 12:05:42
[ComponentsConfiguration] =>
[CompressedBitsPerPixel] => 32/10
[ShutterSpeedValue] => 660/100
[ApertureValue] => 300/100
[BrightnessValue] => 408/100
[ExposureBiasValue] => 0/100
[MaxApertureValue] => 300/100
[MeteringMode] => 5
[LightSource] => 12
[Flash] => 16
[FocalLength] => 1160/100
[SubSecTime] => 718
[FlashPixVersion] => 0100
[ColorSpace] => 1
[ExifImageWidth] => 525
[ExifImageLength] => 700
[FocalPlaneXResolution] => 2678/1
[FocalPlaneYResolution] => 2674/1
[FocalPlaneResolutionUnit] => 3
[SensingMethod] => 2
[FileSource] =>
[SceneType] =>
[ExposureMode] => 0
[WhiteBalance] => 1
[SceneCaptureType] => 0
[Sharpness] => 2
[SubjectDistanceRange] => 1
))
比如你想知道光圈,可以
echo $exif[COMPUTED][ApertureFNumber]; //out f/2.8