summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/verify.cc4
-rw-r--r--src/verify.h4
-rw-r--r--src/verify_j2k.cc4
-rw-r--r--test/verify_test.cc12
4 files changed, 15 insertions, 9 deletions
diff --git a/src/verify.cc b/src/verify.cc
index abc447de..08407920 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -2125,9 +2125,9 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str
*note.error()
);
case VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_2K:
- return compose("The JPEG2000 codestream uses %1 guard bits in a 2K image instead of 1.", note.note().get());
+ return compose("The JPEG2000 codestream uses %1 guard bits in a 2K image instead of 1.", *note.guard_bits());
case VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_4K:
- return compose("The JPEG2000 codestream uses %1 guard bits in a 4K image instead of 2.", note.note().get());
+ return compose("The JPEG2000 codestream uses %1 guard bits in a 4K image instead of 2.", *note.guard_bits());
case VerificationNote::Code::INVALID_JPEG2000_TILE_SIZE:
return process_string("The JPEG2000 tile size is not the same as the image size.");
case VerificationNote::Code::INVALID_JPEG2000_CODE_BLOCK_WIDTH:
diff --git a/src/verify.h b/src/verify.h
index 16151bd1..27316610 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -406,12 +406,12 @@ public:
*/
INVALID_JPEG2000_CODESTREAM,
/** Invalid number of guard bits in a 2K JPEG2000 stream (should be 1) [Bv2.1_10.2.1]
- * note contains the number of guard bits
+ * guard_bits contains the number of guard bits
* reel_index contains the reel index (starting from 0)
*/
INVALID_JPEG2000_GUARD_BITS_FOR_2K,
/** Invalid number of guard bits in a 4K JPEG2000 stream (should be 2) [Bv2.1_10.2.1]
- * note contains the number of guard bits
+ * guard_bits contains the number of guard bits
* reel_index contains the reel index (starting from 0)
*/
INVALID_JPEG2000_GUARD_BITS_FOR_4K,
diff --git a/src/verify_j2k.cc b/src/verify_j2k.cc
index 7ba349a5..06316025 100644
--- a/src/verify_j2k.cc
+++ b/src/verify_j2k.cc
@@ -270,10 +270,10 @@ dcp::verify_j2k(shared_ptr<const Data> j2k, int start_index, int frame_index, in
auto quantization_style = get_8();
int guard_bits = (quantization_style >> 5) & 7;
if (fourk && guard_bits != 2) {
- notes.push_back({ VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_4K, fmt::to_string(guard_bits) });
+ notes.push_back(VerificationNote(VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_4K).set_guard_bits(guard_bits));
}
if (!fourk && guard_bits != 1) {
- notes.push_back({ VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_2K, fmt::to_string(guard_bits) });
+ notes.push_back(VerificationNote(VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_2K).set_guard_bits(guard_bits));
}
ptr += L_qcd - 3;
} else if (*marker_name == "COC") {
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 2ba2dbb9..0f954cd1 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -1026,7 +1026,9 @@ BOOST_AUTO_TEST_CASE (verify_invalid_standard)
};
for (int j = 0; j < 24; ++j) {
- expected.push_back(VN(VC::INVALID_JPEG2000_GUARD_BITS_FOR_2K, string("2")).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id("c6035f97-b07d-4e1c-944d-603fc2ddc242"));
+ expected.push_back(
+ VN(VC::INVALID_JPEG2000_GUARD_BITS_FOR_2K).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id("c6035f97-b07d-4e1c-944d-603fc2ddc242").set_guard_bits(2)
+ );
}
check_verify_result(notes, expected);
@@ -1062,7 +1064,9 @@ BOOST_AUTO_TEST_CASE (verify_invalid_duration)
};
for (int i = 0; i < 23; ++i) {
- expected.push_back(VN(VC::INVALID_JPEG2000_GUARD_BITS_FOR_2K, string("2")).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id("d7576dcb-a361-4139-96b8-267f5f8d7f91"));
+ expected.push_back(
+ VN(VC::INVALID_JPEG2000_GUARD_BITS_FOR_2K).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id("d7576dcb-a361-4139-96b8-267f5f8d7f91").set_guard_bits(2)
+ );
}
check_verify_result({ dir }, {}, expected);
@@ -5932,7 +5936,9 @@ BOOST_AUTO_TEST_CASE(verify_invalid_sound_bit_depth)
};
for (auto i = 0; i < 792; ++i) {
- notes.push_back(VN(VC::INVALID_JPEG2000_GUARD_BITS_FOR_2K, string("2")).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id("fd4796c2-9c84-454c-91f4-13ad127cea8a"));
+ notes.push_back(
+ VN(VC::INVALID_JPEG2000_GUARD_BITS_FOR_2K).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id("fd4796c2-9c84-454c-91f4-13ad127cea8a").set_guard_bits(2)
+ );
}
check_verify_result({ dir }, {}, notes);