diff --git a/TinyEXIF.cpp b/TinyEXIF.cpp index 4382d9d..68d8812 100644 --- a/TinyEXIF.cpp +++ b/TinyEXIF.cpp @@ -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 = ""; diff --git a/TinyEXIF.h b/TinyEXIF.h index 8ff7083..505c415 100644 --- a/TinyEXIF.h +++ b/TinyEXIF.h @@ -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 diff --git a/main.cpp b/main.cpp index a089e81..67af930 100644 --- a/main.cpp +++ b/main.cpp @@ -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";