add serial-number field

This commit is contained in:
cDc
2017-09-12 12:25:49 +03:00
parent ad38b458bf
commit c3c524a782
3 changed files with 9 additions and 0 deletions

View File

@@ -509,6 +509,11 @@ void EXIFInfo::parseIFDExif(EntryParser& parser) {
}
break;
case 0xa431:
// Serial number of the camera
parser.Fetch(SerialNumber);
break;
case 0xa432:
// Focal length and FStop.
if (parser.Fetch(LensInfo.FocalLengthMin, 0))
@@ -932,6 +937,7 @@ void EXIFInfo::clear() {
ImageDescription = "";
Make = "";
Model = "";
SerialNumber = "";
Software = "";
DateTime = "";
DateTimeOriginal = "";

View File

@@ -120,6 +120,7 @@ public:
std::string ImageDescription; // Image description
std::string Make; // Camera manufacturer's name
std::string Model; // Camera model
std::string SerialNumber; // Serial number of the body of the camera
uint16_t Orientation; // Image orientation, start of data corresponds to
// 0: unspecified in EXIF data
// 1: upper left of image

View File

@@ -39,6 +39,8 @@ int main(int argc, const char** argv)
std::cout << "Description " << imageEXIF.ImageDescription << "\n";
if (!imageEXIF.Make.empty() || !imageEXIF.Model.empty())
std::cout << "CameraModel " << imageEXIF.Make << " - " << imageEXIF.Model << "\n";
if (!imageEXIF.SerialNumber.empty())
std::cout << "SerialNumber " << imageEXIF.SerialNumber << "\n";
std::cout << "Orientation " << imageEXIF.Orientation << "\n";
std::cout << "Resolution " << imageEXIF.XResolution << "x" << imageEXIF.YResolution << "\n";
std::cout << "ResolutionUnit " << imageEXIF.ResolutionUnit << "\n";