標籤:
Exif.js 提供了 JavaScript 讀取映像的未經處理資料的功能擴充,例如:拍照方向、相機裝置型號、拍攝時間、ISO 速度、GPS 地理位置等資料。
線上執行個體
執行個體預覽 簡單樣本
執行個體預覽 擷取 base64 編碼檔案資料
執行個體預覽 非同步擷取映像資料
使用方法載入 JavaScript 檔案
- <script src="exif.js"></script>
複製擷取 EXIF 資料
EXIF.getData(document.getElementById(‘imgElement‘), function(){
EXIF.getAllTags(this);
EXIF.getTag(this, ‘Orientation‘);
});
複製API 方法
| 名稱 |
說明 |
| EXIF.getData(img, callback) |
擷取映像的資料 能相容尚未支援提供 EXIF 資料的瀏覽器擷取到中繼資料。 |
| EXIF.getTag(img, tag) |
擷取映像的某個資料 |
| EXIF.getAllTags(img) |
擷取映像的全部資料,值以對象的方式返回 |
| EXIF.pretty(img) |
擷取映像的全部資料,值以字串的方式返回 |
EXIF 標識
| 名稱 |
說明 |
| ExifVersion |
Exif 版本 |
| FlashPixVersion |
FlashPix 版本 |
| ColorSpace |
色域、色彩空間 |
| PixelXDimension |
映像的有效寬度 |
| PixelYDimension |
映像的有效高度 |
| ComponentsConfiguration |
映像構造 |
| CompressedBitsPerPixel |
壓縮時每像素色彩位 |
| MakerNote |
製造商設定的資訊 |
| UserComment |
使用者評論 |
| RelatedSoundFile |
關聯的音效檔 |
| DateTimeOriginal |
建立時間 |
| DateTimeDigitized |
數字化建立時間 |
| SubsecTime |
日期時間(秒) |
| SubsecTimeOriginal |
原始日期時間(秒) |
| SubsecTimeDigitized |
原始日期時間數字化(秒) |
| ExposureTime |
曝光時間 |
| FNumber |
光圈值 |
| ExposureProgram |
曝光程式 |
| SpectralSensitivity |
光譜靈敏度 |
| ISOSpeedRatings |
感光度 |
| OECF |
光電轉換功能 |
| ShutterSpeedValue |
快門速度 |
| ApertureValue |
鏡頭光圈 |
| BrightnessValue |
亮度 |
| ExposureBiasValue |
曝光補償 |
| MaxApertureValue |
最大光圈 |
| SubjectDistance |
物距 |
| MeteringMode |
測光方式 |
| Lightsource |
光源 |
| Flash |
閃光燈 |
| SubjectArea |
主體地區 |
| FocalLength |
焦距 |
| FlashEnergy |
閃光燈強度 |
| SpatialFrequencyResponse |
空間頻率反應 |
| FocalPlaneXResolution |
焦距平面X軸解析度 |
| FocalPlaneYResolution |
焦距平面Y軸解析度 |
| FocalPlaneResolutionUnit |
焦距平面解析度單位 |
| SubjectLocation |
主體位置 |
| ExposureIndex |
曝光指數 |
| SensingMethod |
映像感應器類型 |
| FileSource |
源檔案 |
| SceneType |
情境類型(1 == 直接拍攝) |
| CFAPattern |
CFA 模式 |
| CustomRendered |
自訂影像處理 |
| ExposureMode |
曝光模式 |
| WhiteBalance |
白平衡(1 == 自動,2 == 手動) |
| DigitalZoomRation |
數字變焦 |
| FocalLengthIn35mmFilm |
35毫米膠片焦距 |
| SceneCaptureType |
情境拍攝類型 |
| GainControl |
情境控制 |
| Contrast |
對比 |
| Saturation |
飽和度 |
| Sharpness |
銳度 |
| DeviceSettingDescription |
裝置設定描述 |
| SubjectDistanceRange |
主體距離範圍 |
| InteroperabilityIFDPointer |
|
| ImageUniqueID |
映像唯一ID |
Tiff 相關
| 名稱 |
說明 |
| ImageWidth |
映像寬度 |
| ImageHeight |
映像高度 |
| BitsPerSample |
位元採樣率 |
| Compression |
壓縮方法 |
| PhotometricInterpretation |
像素合成 |
| Orientation |
拍攝方向 |
| SamplesPerPixel |
像素數 |
| PlanarConfiguration |
資料排列 |
| YCbCrSubSampling |
色相抽樣比率 |
| YCbCrPositioning |
色相配置 |
| XResolution |
X方向解析度 |
| YResolution |
Y方向解析度 |
| ResolutionUnit |
解析度單位 |
| StripOffsets |
映像資料位置 |
| RowsPerStrip |
每帶行數 |
| StripByteCounts |
每壓縮帶位元數 |
| JPEGInterchangeFormat |
JPEG SOI 位移量 |
| JPEGInterchangeFormatLength |
JPEG 位元數 |
| TransferFunction |
轉移功能 |
| WhitePoint |
白點色度 |
| PrimaryChromaticities |
主要色度 |
| YCbCrCoefficients |
色彩空間轉換矩陣係數 |
| ReferenceBlackWhite |
黑白參照值 |
| DateTime |
日期和時間 |
| ImageDescription |
映像描述、來源 |
| Make |
生產者 |
| Model |
型號 |
| Software |
軟體 |
| Artist |
作者 |
| Copyright |
著作權資訊 |
GPS 相關
| 名稱 |
說明 |
| GPSVersionID |
GPS 版本 |
| GPSLatitudeRef |
南北緯 |
| GPSLatitude |
緯度 |
| GPSLongitudeRef |
東西經 |
| GPSLongitude |
經度 |
| GPSAltitudeRef |
海拔參照值 |
| GPSAltitude |
海拔 |
| GPSTimeStamp |
GPS 時間戳記 |
| GPSSatellites |
測量的衛星 |
| GPSStatus |
接收器狀態 |
| GPSMeasureMode |
測量模式 |
| GPSDOP |
測量精度 |
| GPSSpeedRef |
速度單位 |
| GPSSpeed |
GPS 接收器速度 |
| GPSTrackRef |
移動方位參照 |
| GPSTrack |
移動方位 |
| GPSImgDirectionRef |
映像方位參照 |
| GPSImgDirection |
映像方位 |
| GPSMapDatum |
地理測量資料 |
| GPSDestLatitudeRef |
目標緯度參照 |
| GPSDestLatitude |
目標緯度 |
| GPSDestLongitudeRef |
目標經度參照 |
| GPSDestLongitude |
目標經度 |
| GPSDestBearingRef |
目標方位參照 |
| GPSDestBearing |
目標方位 |
| GPSDestDistanceRef |
目標距離參照 |
| GPSDestDistance |
目標距離 |
| GPSProcessingMethod |
GPS 處理方法名 |
| GPSAreaInformation |
GPS 區功能變數名 |
| GPSDateStamp |
GPS 日期 |
| GPSDifferential |
GPS 修正 |
下載
Exif.js 讀取映像的中繼資料