Get Photo Information
Last Updated:2020-09-29
Overview
BOS supports to obtain photo information by commands. If the image has exif information, it returns the complete information including exif, and if the image does not contain exif information, it returns the basic information of the image.
The exif information returned includes but is not limited to:
- dateTime、dateTimeOriginal、dateTimeDigitized、format、gpsLatitude、gpsLatitudeRef、gpsLongitude、gpsLongitudeRef、imageHeight、imageWidth、imageSize、make、model、orientation、resolutionX、resolutionY、resolutionUnit.
Note: The exif information contains property information and shooting data of digital photos, however, not every image contains exif information.
How to Get Photo Information
You can use the exif command directly to get the photo information without metrics.
Example
- An example of an image with exif information:
https://doc.bce.baidu.com/bce-documentation/BOS/orient.jpg?exif
Example for return:
{
"dateTime": {
"value": "2016-08-31T14:57:07Z"
},
"dateTimeDigitized": {
"value": "2016-08-31T14:57:07Z"
},
"dateTimeOriginal": {
"value": "2016-08-31T14:57:07Z"
},
"format": {
"value": "JPEG"
},
"gpsLatitude": {
"value": "40/1,2/1,3675/100"
},
"gpsLatitudeRef": {
"value": "N"
},
"gpsLongitude": {
"value": "116/1,16/1,257/100"
},
"gpsLongitudeRef": {
"value": "E"
},
"imageHeight": {
"value": "2448"
},
"imageSize": {
"value": "1225883"
},
"imageWidth": {
"value": "3264"
},
"make": {
"value": "Apple"
},
"model": {
"value": "iPhone 6"
},
"resolutionUnit": {
"value": "2"
},
"resolutionX": {
"value": "72/1"
},
"resolutionY": {
"value": "72/1"
}
}
- An example of an image without exif information:
https://doc.bce.baidu.com/bce-documentation/BOS/image.jpg?exif
Example for return:
{
"format": {
"value": "JPEG"
},
"imageHeight": {
"value": "296"
},
"imageSize": {
"value": "63506"
},
"imageWidth": {
"value": "279"
}
}