| 184 | } |
| 185 | |
| 186 | TiffDecoder::TiffDecoder(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, TiffComponent* pRoot, |
| 187 | FindDecoderFct findDecoderFct) : |
| 188 | exifData_(exifData), iptcData_(iptcData), xmpData_(xmpData), pRoot_(pRoot), findDecoderFct_(findDecoderFct) { |
| 189 | // #1402 Fujifilm RAF. Search for the make |
| 190 | // Find camera make in existing metadata (read from the JPEG) |
| 191 | ExifKey key("Exif.Image.Make"); |
| 192 | if (exifData_.findKey(key) != exifData_.end()) { |
| 193 | make_ = exifData_.findKey(key)->toString(); |
| 194 | } else { |
| 195 | // Find camera make by looking for tag 0x010f in IFD0 |
| 196 | TiffFinder finder(0x010f, IfdId::ifd0Id); |
| 197 | pRoot_->accept(finder); |
| 198 | auto te = dynamic_cast<TiffEntryBase*>(finder.result()); |
| 199 | if (te && te->pValue()) { |
| 200 | make_ = te->pValue()->toString(); |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | void TiffDecoder::visitEntry(TiffEntry* object) { |
| 206 | decodeTiffEntry(object); |