| 365 | } // RiffVideo::writeMetadata |
| 366 | |
| 367 | void RiffVideo::readMetadata() { |
| 368 | if (io_->open() != 0) |
| 369 | throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); |
| 370 | |
| 371 | // Ensure that this is the correct image type |
| 372 | if (!isRiffType(*io_, false)) { |
| 373 | if (io_->error() || io_->eof()) |
| 374 | throw Error(ErrorCode::kerFailedToReadImageData); |
| 375 | throw Error(ErrorCode::kerNotAnImage, "RIFF"); |
| 376 | } |
| 377 | |
| 378 | IoCloser closer(*io_); |
| 379 | clearMetadata(); |
| 380 | |
| 381 | xmpData_["Xmp.video.FileSize"] = io_->size(); |
| 382 | xmpData_["Xmp.video.MimeType"] = mimeType(); |
| 383 | |
| 384 | HeaderReader header(io_); |
| 385 | xmpData_["Xmp.video.Container"] = header.getId(); |
| 386 | |
| 387 | xmpData_["Xmp.video.FileType"] = readStringTag(io_); |
| 388 | |
| 389 | decodeBlocks(); |
| 390 | } // RiffVideo::readMetadata |
| 391 | |
| 392 | RiffVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) { |
| 393 | Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata); |
nothing calls this directly
no test coverage detected