为了正常的体验网站,请在浏览器设置里面开启Javascript功能!
首页 > php查图片的exif信息

php查图片的exif信息

2017-10-19 9页 doc 29KB 11阅读

用户头像

is_531654

暂无简介

举报
php查图片的exif信息php查图片的exif信息 ï??å›?片的exifä??æ??ï,Œå?‚è?ƒæ??ç?„$new_img_info PHPä??ç •:---------------------------------------------------------------------- ---------- $val) { if ($name==$ImageInfo) { $InfoVal = &$val; break; } } return $InfoVal; } function GetImage...
php查图片的exif信息
php查图片的exif信息 ï??å›?片的exifä??æ??ï,Œå?‚è?ƒæ??ç?„$new_img_info PHPä??ç •:---------------------------------------------------------------------- ---------- $val) { if ($name==$ImageInfo) { $InfoVal = &$val; break; } } return $InfoVal; } function GetImageInfo($img) { $imgtype = array("", "GIF", "JPG", "PNG", "SWF", "PSD", "BMP", "TIFF(intel byte order)", "TIFF(motorola byte order)", "JPC", "JP2", "JPX", "JB2", "SWC", "IFF", "WBMP", "XBM"); $Orientation = array("", "top left side", "top right side", "bottom right side", "bottom left side", "left side top", "right side top", "right side bottom", "left side bottom"); $ResolutionUnit = array("", "", "è‹?å??", "å??ç??"); $YCbCrPositioning = array("", "the center of pixel array", "the datum point"); $ExposureProgram = array("未å?šä?‰", "手åŠ?", "æ ‡å‡†ç?‹åº ", "光圈先å†?", "å??é??å…ˆå†?", "æ??æ??å…ˆå†?", "è??åŠ?æ??å,?", "è‚?åƒ æ??å? ", "é??æ??æ??å? "); $MeteringMode_arr = array( "0" => "未çŸ,", "1" => "å??å?‡", "2" => "ä??å,?é‡?ç‚?å??å?‡æµ‹å…‰", "3" => "ç‚?测", "4" => "分区", "5" => "è?„ä,?", "6" => "å??éƒ?", "255" => "å…?ä??" ); $Lightsource_arr = array( "0" => "未çŸ,", "1" => "æ?,å…‰", "2" => "è??å…‰ç??", "3" => "é’?ä? ç•?", "10" => "é?ªå…‰ç•?", "17" => "æ ‡å‡†ç??å…‰A", "18" => "æ ‡å‡†ç??å…‰B", "19" => "æ ‡å‡†ç??å…‰C", "20" => "D55", "21" => "D65", "22" => "D75", "255" => "å…?ä??" ); $Flash_arr = array( "0" => "flash did not fire", "1" => "flash fired", "5" => "flash fired but strobe return light not detected", "7" => "flash fired and strobe return light detected", ); $exif = exif_read_data ($img,"IFD0"); if ($exif===false) { $new_img_info = array ("æ?‡ä??ä??æ•?" => "æ??有å›?片EXIFä??æ•?"); } else { $exif = exif_read_data ($img,0,true); $new_img_info = array ( "æ?‡ä??ä??æ•?" => "-----------------------------", "æ?‡ä??å " => $exif[FILE][FileName], "æ?‡ä??ç??å?‹" => $imgtype[$exif[FILE][FileType]], "æ?‡ä??æ ?å? " => $exif[FILE][MimeType], "æ?‡ä??å,?å? " => $exif[FILE][FileSize], "æ??é??æˆ?" => date("Y-m-d H:i:s",$exif[FILE][FileDateTime]), "å›?åƒ ä??æ•?" => "-----------------------------", "å›?片è??æ??" => $exif[IFD0][ImageDescription], "åˆ?é? å?†" => $exif[IFD0][Make], "å?‹å ?" => $exif[IFD0][Model], "æ??å?‘" => $Orientation[$exif[IFD0][Orientation]], "æ??å??分è??ç?‡" => $exif[IFD0][XResolution].$ResolutionUnit[$exif[IFD0][ResolutionUnit]], "å?‚ç›?分è??ç?‡" => $exif[IFD0][YResolution].$ResolutionUnit[$exif[IFD0][ResolutionUnit]], "创å?ºè,?ä??" => $exif[IFD0][Software], "ä??æ”?æ??é??" => $exif[IFD0][DateTime], "ä,œè?…" => $exif[IFD0][Artist], "YCbCrä??ç,?æ??åˆ?" => $YCbCrPositioning[$exif[IFD0][YCbCrPositioning]], "版æ?ƒ" => $exif[IFD0][Copyright], "æ‘„å,?版æ?ƒ" => $exif[COMPUTED][Copyright.Photographer], "ç??è?‘版æ?ƒ" => $exif[COMPUTED][Copyright.Editor], "æ‹?æ‘„ä??æ??" => "-----------------------------", "Exif版æœ?" => $exif[EXIF][ExifVersion], "FlashPix版æœ?" => "Ver. ".number_format($exif[EXIF][FlashPixVersion]/100,2), "æ‹?æ‘„æ??é??" => $exif[EXIF][DateTimeOriginal], "æ??å??åŒ?æ??é??" => $exif[EXIF][DateTimeDigitized], "æ‹?摄分è??ç?‡é??" => $exif[COMPUTED][Height], "æ‹?摄分è??ç?‡å?," => $exif[COMPUTED][Width], /* The actual aperture value of lens when the image was taken. Unit is APEX. To convert this value to ordinary F-number(F-stop), calculate this value's power of root 2 (=1.4142). For example, if the ApertureValue is '5', F-number is pow(1.41425,5) = F5.6. */ "光圈" => $exif[EXIF][ApertureValue], "å??é??é?Ÿåº?" => $exif[EXIF][ShutterSpeedValue], "å??é??光圈" => $exif[COMPUTED][ApertureFNumber], "æœ?å,?光圈å?," => "F".$exif[EXIF][MaxApertureValue], "æ›?å…‰æ??é??" => $exif[EXIF][ExposureTime], "F-Number" => $exif[EXIF][FNumber], "测光æ??å, " => GetImageInfoVal($exif[EXIF][MeteringMode],$MeteringMode_arr), "å…‰æº " => GetImageInfoVal($exif[EXIF][LightSource], $Lightsource_arr), "é?ªå…‰ç•?" => GetImageInfoVal($exif[EXIF][Flash], $Flash_arr), "æ›?å…‰æ??å,?" => ($exif[EXIF][ExposureMode]==1?"手åŠ?":"自åŠ?"), "ç?,å??è??" => ($exif[EXIF][WhiteBalance]==1?"手åŠ?":"自åŠ?"), "æ›?å…‰ç?‹åº?" => $ExposureProgram[$exif[EXIF][ExposureProgram]], /* Brightness of taken subject, unit is APEX. To calculate Exposure(Ev) from BrigtnessValue(Bv), you must add SensitivityValue(Sv). Ev=Bv+Sv Sv=log((ISOSpeedRating/3.125),2) ISO100:Sv=5, ISO200:Sv=6, ISO400:Sv=7, ISO125:Sv=5.32. */ "æ›?å…‰è?,å??" => $exif[EXIF][ExposureBiasValue]."EV", "ISOæ„Ÿå…‰åº?" => $exif[EXIF][ISOSpeedRatings], "分é‡?é…?ç,?" => (bin2hex($exif[EXIF][ComponentsConfiguration])=="01020300"?"YCbCr":"RGB"),//'0x04,0x05,0x06,0x00'="RGB" '0x01,0x02,0x03,0x00'="YCbCr" "å›?åƒ?å?‹ç,?ç?‡" => $exif[EXIF][CompressedBitsPerPixel]."Bits/Pixel", "å??ç„?è? ç??" => $exif[COMPUTED][FocusDistance]."m", "ç„?è? " => $exif[EXIF][FocalLength]."mm", "ç?‰ä??35mmç„?è? " => $exif[EXIF][FocalLengthIn35mmFilm]."mm", /* Stores user comment. This tag allows to use two-byte character code or unicode. First 8 bytes describe the character code. 'JIS' is a Japanese character code (known as Kanji). '0x41,0x53,0x43,0x49,0x49,0x00,0x00,0x00':ASCII '0x4a,0x49,0x53,0x00,0x00,0x00,0x00,0x00':JIS '0x55,0x4e,0x49,0x43,0x4f,0x44,0x45,0x00':Unicode '0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00':Undefined */ "ç”?æˆ?æ??释ç,?ç •" => $exif[COMPUTED][UserCommentEncoding], "ç”?æˆ?æ??释" => $exif[COMPUTED][UserComment], "è‰?å,?ç?ºé??" => ($exif[EXIF][ColorSpace]==1?"sRGB":"Uncalibrated"), "Exifå›?åƒ å??åº?" => $exif[EXIF][ExifImageLength], "Exifå›?åƒ?é??åº?" => $exif[EXIF][ExifImageWidth], "æ?‡ä??æ ?æº " => (bin2hex($exif[EXIF][FileSource])==0x03?"digital still camera":"unknown"), "场æ??ç??å?‹" => (bin2hex($exif[EXIF][SceneType])==0x01?"A directly photographed image":"unknown"), "ç,?ç?,å›?æ?‡ä??æ ?å? " => $exif[COMPUTED][Thumbnail.FileType], "ç,?ç?,å›?Mimeæ ?å? " => $exif[COMPUTED][Thumbnail.MimeType] ); } return $new_img_info; } $innerhtml = ""; $exif = GetImageInfo($_GET['img']); $innerhtml .= ""; foreach($exif as $name=>$val) { $innerhtml .= ""; } $innerhtml .= "
{$name}{$val}
"; if ($_GET['img']) { $image = exif_thumbnail($_GET['img']); } else { $image = false; } if ($image!==false) { $innerhtml .= ""; } else { // no thumbnail available, handle the error here $innerhtml .= "No thumbnail available"; } $innerhtml .= "
"; ?> å›?片ä??æ•?
/
本文档为【php查图片的exif信息】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索