MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / readMetadata

Method readMetadata

src/riffvideo.cpp:367–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365} // RiffVideo::writeMetadata
366
367void 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
392RiffVideo::HeaderReader::HeaderReader(const BasicIo::UniquePtr& io) {
393 Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);

Callers

nothing calls this directly

Calls 9

ErrorFunction · 0.85
strErrorFunction · 0.85
isRiffTypeFunction · 0.85
readStringTagFunction · 0.85
eofMethod · 0.80
mimeTypeClass · 0.70
openMethod · 0.45
errorMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected