Skip to content

Commit c4bb82c

Browse files
committed
rstest will write out all frames
1 parent b1ec3d7 commit c4bb82c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/utilities/rstest/rstest.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,12 @@ size_t process(const std::string& filename, const CameraMetaData* metadata,
386386
ofstream f(hashfile);
387387
f << img_hash(decoder->mRaw, noSamples);
388388
if (o.dump)
389-
/// TODO modify to handle multiframe images
390-
writeImage(decoder->mRaw.get(0).get(), filename);
389+
for (rawspeed::RawImage::storage_t::size_type i = 0;
390+
i < decoder->mRaw.size(); ++i) {
391+
std::stringstream s;
392+
s << filename << "." << i;
393+
writeImage(decoder->mRaw.get(i).get(), s.str());
394+
}
391395
} else {
392396
// do generate the hash string regardless.
393397
std::string h = img_hash(decoder->mRaw, noSamples);
@@ -403,8 +407,12 @@ size_t process(const std::string& filename, const CameraMetaData* metadata,
403407
ofstream f(filename + ".hash.failed");
404408
f << h;
405409
if (o.dump)
406-
/// TODO modify to handle multiframe images
407-
writeImage(decoder->mRaw.get(0).get(), filename + ".failed");
410+
for (rawspeed::RawImage::storage_t::size_type i = 0;
411+
i < decoder->mRaw.size(); ++i) {
412+
std::stringstream s;
413+
s << filename << "." << i << ".failed";
414+
writeImage(decoder->mRaw.get(i).get(), s.str());
415+
}
408416
throw RstestHashMismatch("hash/metadata mismatch", time);
409417
}
410418
}

0 commit comments

Comments
 (0)