您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP 获取图片信息exif

2025/10/1 12:17:02发布29次查看
代码:
$file_arr = read_exif_data('./1.png');var_dump($file_arr);
结果:
array (size=49) 'filename' => string '2.png' (length=5) 'filedatetime' => int 1446107171 'filesize' => int 2640955 'filetype' => int 2 'mimetype' => string 'image/jpeg' (length=10) 'sectionsfound' => string 'any_tag, ifd0, thumbnail, exif, interop' (length=39) 'computed' => array (size=12) 'html' => string 'width=4128 height=2322' (length=26) 'height' => int 2322 'width' => int 4128 'iscolor' => int 1 'byteordermotorola' => int 0 'aperturefnumber' => string 'f/2.2' (length=5) 'usercomment' => null 'usercommentencoding' => string 'ascii' (length=5) 'thumbnail.filetype' => int 2 'thumbnail.mimetype' => string 'image/jpeg' (length=10) 'thumbnail.height' => int 288 'thumbnail.width' => int 512 'imagewidth' => int 4128 'imagelength' => int 2322 'make' => string 'samsung' (length=7) 'model' => string 'gt-i9500' (length=8) 'orientation' => int 3 'xresolution' => string '72/1' (length=4) 'yresolution' => string '72/1' (length=4) 'resolutionunit' => int 2 'software' => string 'i9500zcuhnd1' (length=12) 'datetime' => string '2015:10:29 16:05:28' (length=19) 'ycbcrpositioning' => int 1 'exif_ifd_pointer' => int 226 'thumbnail' => array (size=9) 'imagewidth' => int 512 'imagelength' => int 288 'compression' => int 6 'orientation' => int 3 'xresolution' => string '72/1' (length=4) 'yresolution' => string '72/1' (length=4) 'resolutionunit' => int 2 'jpeginterchangeformat' => int 10570 'jpeginterchangeformatlength' => int 11304 'exposuretime' => string '1/33' (length=4) 'fnumber' => string '22/10' (length=5) 'exposureprogram' => int 2 'isospeedratings' => int 160 'exifversion' => string '0220' (length=4) 'datetimeoriginal' => string '2015:10:29 16:05:28' (length=19) 'datetimedigitized' => string '2015:10:29 16:05:28' (length=19) 'shutterspeedvalue' => string '506/100' (length=7) 'aperturevalue' => string '227/100' (length=7) 'brightnessvalue' => string '177/100' (length=7) 'exposurebiasvalue' => string '0/10' (length=4) 'maxaperturevalue' => string '227/100' (length=7) 'meteringmode' => int 2
参数说明:
'文件名' => $infoall['filename'], '文件修改时间' => date('y:m:d h:i:s',$infoall['filedatetime']), '文件大小' => round($infoall['filesize']/1024) . 'kb', 'exif文件类型' => $this->getimgtype($imgpath,'exif'), 'mime文件类型' => $infoall['mimetype'], '找到sections' => $infoall['sectionsfound'], 'html中图片宽高' => $infoall['html'], '图片高度' => $infoall['height'] . 'px', '图片宽度' => $infoall['width'] . 'px', '是否彩色' => $infoall['iscolor'] == 1 ? '是' : '否', '是否为motorola字节顺序' => $infoall['byteordermotorola'] == 1 ? '是' : '否', '光圈数' => $infoall['aperturefnumber'], '作者注释' => $infoall['comments'], '作者' => $infoall['author'], '用户注释' => $infoall['usercomment'], '用户注释编码' => $infoall['usercommentencoding'], '缩略图exif文件类型' => $this->getimgtype($imgpath,'exif'), '缩略图mime文件类型' => $infoall['thumbnail.mimetype'], '制造商' => $infoall['make'], '型号' => $infoall['model'], '方向' => array_search($infoall['orientation'],array( 'top left side' => 1, 'top right side' => 2, 'bottom right side' => 3, 'bottom left side' => 4, 'left side top' => 5, 'right side top' => 6, 'right side bottom' => 7, 'left side bottom' => 8 )), '水平分辨率' => $infoall['xresolution'], '垂直分辨率' => $infoall['yresolution'], '分辨率单位' => array_search($infoall['resolutionunit'],array( '无单位' => 1, '英寸' => 2, '厘米' => 3 )), '创建软件' => $infoall['software'], '最后修改时间' => $infoall['datetime'], 'ycbcr位置控制' => $infoall['ycbcrpositioning'] == 1 ? '像素阵列的中心' : '基准点', 'exif图像ifd的指针' => $infoall['exif_ifd_pointer'], '压缩方式' => $infoall['compression'] == 6 ? 'jpeg压缩' : '无压缩', 'jpeg soi偏移' => $infoall['jpeginterchangeformat'], 'jpeg数据字节' => $infoall['jpeginterchangeformatlength'], '曝光时间' => $infoall['exposuretime'] . '秒', '焦距比数' => $infoall['fnumber'], '曝光程序' => array_search($infoall['exposureprogram'],array( '手动控制' => 1, '程序控制' => 2, '光圈优先' => 3, '快门优先' => 4, '景深优先' => 5, '运动模式' => 6, '肖像模式' => 7, '风景模式' => 8 )), 'iso感光度' => $infoall['isospeedratings'], 'exif版本' => $infoall['exifversion'], '拍摄时间' => $infoall['datetimeoriginal'], '数字化时间' => $infoall['datetimedigitized'], '分量配置' => $infoall['componentsconfiguration'], '图像压缩率' => $infoall['compressedbitsperpixel'], '曝光补偿' => $infoall['exposurebiasvalue'] . '电子伏特', '最大光圈值' => $infoall['maxaperturevalue'], '测光模式' => array_search($infoall['meteringmode'],array( '未知' => 0, '平均' => 1, '中央重点平均测光' => 2, '点测' => 3, '分区' => 4, '评估' => 5, '局部' => 6, '其他' => 255 )), '光源' => array_search($infoall['lightsource'],array( '未知' => 0, '日光灯' => 1, '荧光灯' => 2, '钨丝灯' => 3, '闪光灯' => 10, '标准灯光a' => 17, '标准灯光b' => 18, '标准灯光c' => 19, 'd55' => 20, 'd65' => 21, 'd75' => 22, '其他' => 255, )), '闪光灯' => array_search($infoall['flash'],array( '闪光灯未闪光' => 0, '闪光灯已闪光' => 1, '闪光灯已闪光但频闪观测器未检测到返回光源' => 5, '闪光灯已闪光,频闪观测器检测到返回光源' => 7 )), '焦距' => $infoall['focallength'] . '毫米', '亚秒时间' => $infoall['subsectime'], '亚秒级拍摄时间' => $infoall['subsectimeoriginal'], '亚秒级数字化时间' => $infoall['subsectimedigitized'], 'flashpix版本' => $infoall['flashpixversion'], '色彩空间' => $infoall['colorspace'] == 1 ? 'srgb' : 'uncalibrated', 'exif图片宽度' => $infoall['exifimagewidth'] . 'px', 'exif图片高度' => $infoall['exifimagelength'] . 'px', 'ifd格式数据偏移量' => $infoall['interoperabilityoffset'], '彩色区域传感器类型' => $infoall['sensingmethod'] == 2 ? '单色区传感器' : '其他', '图片像源' => $infoall['filesource'] == '0x03' ? '数码相机' : '其他', '场景类型' => $infoall['scenetype'] == '0x01' ? '直接拍摄' : '其他', '滤波阵列图案' => $infoall['cfapattern'], '自定义图像处理' => $infoall['customrendered'], '曝光模式' => $infoall['customrendered'] == 1 ? '手动' : '自动', '白平衡' => $infoall['whitebalance'] == 1 ? '手动' : '自动', '数位变焦倍率' => $infoall['digitalzoomratio'], '等价35mm焦距' => $infoall['focallengthin35mmfilm'] . '毫米', '取景模式' => array_search($infoall['scenecapturetype'],array( '自动' => 0, '肖像场景' => 1, '景观场景' => 2, '运动场景' => 3, '夜景' => 4, '自动曝光' => 5, '光圈优先自动曝光' => 256, '快门优先自动曝光' => 512, '手动曝光' => 768, )), '增益控制' => $infoall['gaincontrol'], '对比度' => array_search($infoall['contrast'],array( '低' => -1, '普通' => 0, '高' => 1 )), '饱和度' => array_search($infoall['saturation'],array( '低' => -1, '普通' => 0, '高' => 1 )), '清晰度' => array_search($infoall['sharpness'],array( '低' => -1, '普通' => 0, '高' => 1 )), '对焦距离' => array_search($infoall['subjectdistancerange'],array( '未知' => 0, '微距' => 1, '近景' => 2, '远景' => 3 )), 'interoperability指数' => $infoall['interoperabilityindex'], 'interoperability版本' => $infoall['interoperabilityversion']
以上就介绍了php 获取图片信息exif,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product