: This article mainly introduces PHP to obtain image information exif. For more information about PHP tutorials, see. Code:
$file_arr = read_exif_data('./1.png');var_dump($file_arr);
Result:
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
Parameter description:
'File name' => $ infoAll ['filename'], 'File modification time' => date ('Y: m: d H: I: S ', $ infoAll ['filedatetime']), 'File size' => round ($ infoAll ['filesize']/1024 ). 'KB', 'exif file type '=> $ this-> getImgtype ($ imgPath, 'exif'), 'Mime file type' => $ infoAll ['mimetype '], 'ctions s' => $ infoAll ['regionsfound '], 'width and height of the image in html' => $ infoAll ['HTML '], 'image Height '=> $ infoAll ['height']. 'px ', 'image width' => $ infoAll ['width']. 'px ', 'color?' => $ infoAll ['iscolo R'] = 1? 'Yes': 'No', 'is the Motorola byte sequence '=> $ infoAll ['byteordermotorola'] = 1? 'Yes': 'No', 'aperture number' => $ infoAll ['aperturefnumber'], 'author annotation' => $ infoAll ['comments'], 'author '=> $ infoAll ['autor'], 'user annotation' => $ infoAll ['usercomment'], 'user annotation encoding' => $ infoAll ['usercommentencoding'], 'thumbnail Exif file type '=> $ this-> getImgtype ($ imgPath, 'exif '), 'thumbnail Mime file type '=> $ infoAll ['thumbnail. mimeType '], 'manufacturer' => $ infoAll ['make'], 'Model '=> $ infoAll ['model'], 'direction' => array_search ($ infoAll ['orientation'], array (' P left side '=> 1, 'Top right lateral' => 2, 'bottom right lateral '=> 3, 'bottom left lateral' => 4, 'Left side top' => 5, 'Right side top' => 6, 'Right side bottom '=> 7, 'left side bottom' => 8 )), 'horizontal resolution' => $ infoAll ['xresolution'], 'vertical resolution' => $ infoAll ['yresolution'], 'resolution unit '=> array_search ($ infoAll ['resolutionunit'], array ('No unit '=> 1, 'inches => 2, 'centimeter '=> 3), 'create Software' => $ infoAll ['soft'], 'Last modification time' => $ InfoAll ['datetime'], 'ycbcr location control' => $ infoAll ['ycbcrpositioning '] = 1? 'Pixel array center': 'datum point', 'exif image IFD pointer '=> $ infoAll ['exif _ IFD_Pointer'], 'compression mode' => $ infoAll ['compression'] = 6? & Apos; jpeg compression & apos;: & apos; no compression & apos;, & apos; jpeg soi Offset & apos; $ infoAll [& apos; JPEGInterchangeFormatLength], 'exposure time' => $ infoAll ['exposuretime']. 'second', 'Focal length ratio number' => $ infoAll ['fnumber'], 'exposure project' => array_search ($ infoAll ['exposureprogram '], array ('manual control' => 1, 'Program control' => 2, 'aperture priority '=> 3, 'Shutter priority' => 4, 'depth of field prioritized '=> 5, 'motion mode' => 6, 'portrait mode' => 7, 'landscape mode' => 8 )), 'ISO sensitivity '=> $ infoAll ['isospeedratings' ], 'Exif version' => $ infoAll ['ifversion'], 'Shooting time' => $ infoAll ['datetimeoriginal'], 'digitization time' => $ infoAll ['datetimedidized'], 'component configuration' => $ infoAll ['componentsconfiguration'], 'image compression rate' => $ infoAll ['compressedbitsperpixel '], 'exposure compensating' => $ infoAll ['exposurebiasvalue']. 'electronic Volt ', 'maximum aperture value' => $ infoAll ['maxaperturevalue'], 'metering mode' => array_search ($ infoAll ['meteringmode'], array ('Unknown '=> 0, 'averaged' => 1, 'Central key average guang' => 2, 'Spot test' => 3, 'Partition' => 4, 'evaluate' => 5, 'local' => 6, 'others' => 255 )), 'lightsource' => array_search ($ infoAll ['lightsource'], array ('Unknown '=> 0, 'fluorescent lights' => 1, 'fluorescent lights '=> 2, 'tungsten lamps '=> 3, 'flashlights' => 10, 'standard lamps a' => 17, 'standard lamps B '=> 18, 'standard lighting c' => 19, 'd55' => 20, 'd65' => 21, 'd75' => 22, 'others' => 255 ,)), 'flash' => array_search ($ infoAll ['Flash'], array ('flashlight not Flash' => 0, 'flashlight already Flash' => 1, 'The flashlight is flashing, but the strophet observer does not detect the returned light source '=> 5, 'The flashlight is flashing, and the strophet observer detects the returned light source. '=> 7), 'focal name' => $ infoAll ['focallength']. 'millimeters ', 'sub-second time' => $ infoAll ['subsectime'], 'sub-second shooting time' => $ infoAll ['subsectimeoriginal'], 'Second-level digitization time' => $ infoAll ['subsectimedigitized'], 'flashpix version' => $ infoAll ['flashpixversion'], 'color space' => $ infoAll ['colorspace'] = 1? 'Srg': 'uncalibrated ', 'exif Image width' => $ infoAll ['ifimagewidth']. 'px ', 'exif Image height' => $ infoAll ['existimagelength ']. 'px ', 'ifd format data offset' => $ infoAll ['interoperabilityoffset'], 'color area sensor type' => $ infoAll ['sensingmethod'] = 2? 'Sensor in monochrome region': 'others', 'image source '=> $ infoAll ['filesource'] = '0x03 '? 'Digital camera ': 'others', 'scenario type' => $ infoAll ['scenetype'] = '0x01 '? 'Direct shooting ': 'others', 'filtered array pattern' => $ infoAll ['cfapattern '], 'custom Image processing' => $ infoAll ['customenered'], 'exposure mode' => $ infoAll ['mrmrendered'] = 1? 'Manually ': 'auto', 'White whitel' => $ infoAll ['whitebalance'] = 1? 'Handler': 'auto', 'digital zoom overput' => $ infoAll ['digitalzoomratio '], 'equivalent to 35mm focal point' => $ infoAll ['focallengthin35mmfilm']. 'millimeter ', 'framing mode' => array_search ($ infoAll ['scenecapturetype'], array ('auto' => 0, 'portrait mode' => 1, 'landscape scene '=> 2, 'motion scene' => 3, 'nightscape '=> 4, 'autoexposure' => 5, 'aperture priority autoexposure '=> 256, 'Shutter priority autoexposure' => 512, 'manual exposures '=> 768 ,)), 'gain control' => $ infoAll ['gaincontrol'], 'contrast '=> array_search ($ infoAll ['contrast'], array ('low' =>-1, 'normal' => 0, 'high' => 1), 'saturation '=> array_search ($ infoAll ['saturation'], array ('low' =>-1, 'normal' => 0, 'high' => 1 )), 'clear' => array_search ($ infoAll ['sharpness '], array ('low' =>-1, 'normal' => 0, 'High' => 1), 'Focus distance '=> array_search ($ infoAll ['subjectdistancerange'], array ('Unknown '=> 0, 'macro '=> 1, 'near view' => 2, 'prospective' => 3), 'interoperability index' => $ infoAll ['interoperabilityindex'], 'interoperability version' => $ infoAll ['interoperabilityversion']
The above introduces PHP to obtain image information exif, including some content, and hope to be helpful to friends who are interested in PHP tutorials.