获取图片信息
获取信息类型
获取基本信息
获取图片基本信息,包括图片的宽度、高度和所占磁盘大小
请求格式
请求URL@info
返回格式
{
"height": 2592,
"size": 2093321,
"width": 1936
}
height 表示图片的高度
size 表示图片的大小, 单位:字节(B)
width 表示图片的宽度
示例
http://www.ct-accel-demo.com/test2.jpeg@info
{
"height": 2592,
"size": 2093321,
"width": 1936
}
获取exif信息
某些设备拍摄出的照片中包含exif信息,用于记录照片的属性信息和拍摄数据。这些信息可以通过 @exif 来获取,返回格式是JSON格式,目前支持返回的类型包括但不限于以下类型:
Latitude
Longitude
East or West Longitude
North or South Latitude
Exif Version
Date and Time
Color Space
Compression
FlashPixVersion
GPS Tag Version
Geodetic Survey Data Used
Orientation
Padding
Resolution Unit
Software
X-Resolution
Y-Resolution
注意:并非每一张图片都包含 exif 信息。如果原图没有 exif信息,当您请求 exif 信息时,会产生空的返回.
请求格式
请求URL@exif
返回格式
json格式
示例
- 包含exif信息的图片示例
http://www.ct-accel-demo.com/test2.jpeg@exif
返回信息
{
"Altitude": {
"value": "13.898"
},
"Altitude Reference": {
"value": "Sea level"
},
"Aperture": {
"value": "2.97 EV (f/2.8)"
},
"Color Space": {
"value": "sRGB"
},
"Components Configuration": {
"value": "Y Cb Cr -"
},
"Compression": {
"value": "JPEG compression"
},
"Date and Time": {
"value": "2016:10:06 15:48:24"
},
"Date and Time (Digitized)": {
"value": "2011:05:19 08:36:32"
},
"Date and Time (Original)": {
"value": "2011:05:19 08:36:32"
},
"East or West Longitude": {
"value": "E"
},
"Exif Version": {
"value": "Exif Version 2.21"
},
"Exposure Mode": {
"value": "Auto exposure"
},
"Exposure Program": {
"value": "Normal program"
},
"Exposure Time": {
"value": "1/1257 sec."
},
"F-Number": {
"value": "f/2.8"
},
"Flash": {
"value": "Flash did not fire, auto mode"
},
"FlashPixVersion": {
"value": "FlashPix Version 1.0"
},
"Focal Length": {
"value": "3.9 mm"
},
"GPS Image Direction": {
"value": "14.740"
},
"GPS Image Direction Reference": {
"value": "T"
},
"GPS Time (Atomic Clock)": {
"value": "00:36:3099.00"
},
"ISO Speed Ratings": {
"value": "80"
},
"Latitude": {
"value": "22, 25.27, 0"
},
"Longitude": {
"value": "114, 12.86, 0"
},
"Manufacturer": {
"value": "Apple"
},
"Metering Mode": {
"value": "Pattern"
},
"Model": {
"value": "iPhone 4"
},
"North or South Latitude": {
"value": "N"
},
"Orientation": {
"value": "Top-left"
},
"Pixel X Dimension": {
"value": "1936"
},
"Pixel Y Dimension": {
"value": "2592"
},
"Resolution Unit": {
"value": "Inch"
},
"Scene Capture Type": {
"value": "Standard"
},
"Sensing Method": {
"value": "One-chip color area sensor"
},
"Sharpness": {
"value": "Hard"
},
"Shutter Speed": {
"value": "10.30 EV (1/1256 sec.)"
},
"Software": {
"value": "GIMP 2.8.6"
},
"Subject Area": {
"value": "Within rectangle (width 699, height 696) around (x,y) = (1295,967)"
},
"White Balance": {
"value": "Auto white balance"
},
"X-Resolution": {
"value": "72"
},
"Y-Resolution": {
"value": "72"
},
"YCbCr Positioning": {
"value": "Centered"
}
}
获取图片主色调
获取图片的主色调
请求格式
请求URL@imageAve
返回格式
0xRRGGBB (6位16进制数,每两位代表一个颜色,顺序为红绿蓝)
示例
http://www.ct-accel-demo.com/test2.jpeg@imageAve
得到结果:
{
"RGB":"0x2c60b3"
}