| 68 | } // OrfImage::printStructure |
| 69 | |
| 70 | void OrfImage::readMetadata() { |
| 71 | #ifdef EXIV2_DEBUG_MESSAGES |
| 72 | std::cerr << "Reading ORF file " << io_->path() << "\n"; |
| 73 | #endif |
| 74 | if (io_->open() != 0) { |
| 75 | throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); |
| 76 | } |
| 77 | IoCloser closer(*io_); |
| 78 | // Ensure that this is the correct image type |
| 79 | if (!isOrfType(*io_, false)) { |
| 80 | if (io_->error() || io_->eof()) |
| 81 | throw Error(ErrorCode::kerFailedToReadImageData); |
| 82 | throw Error(ErrorCode::kerNotAnImage, "ORF"); |
| 83 | } |
| 84 | clearMetadata(); |
| 85 | ByteOrder bo = OrfParser::decode(exifData_, iptcData_, xmpData_, io_->mmap(), io_->size()); |
| 86 | setByteOrder(bo); |
| 87 | } |
| 88 | |
| 89 | void OrfImage::writeMetadata() { |
| 90 | #ifdef EXIV2_DEBUG_MESSAGES |