diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-30 22:49:06 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-15 17:13:38 +0100 |
| commit | 622aee8209da3badfa155eb8b1b003135a2fca61 (patch) | |
| tree | 409efb8bd376f9b60bd93167ccc2849ce714c65c /src | |
| parent | 5d4e90e80ed7552dfc96e967b5d96a5eb5a72c9f (diff) | |
Use new size_in_pixels for INVALID_PICTURE_SIZE_IN_PIXELS.
Diffstat (limited to 'src')
| -rw-r--r-- | src/verify.cc | 12 | ||||
| -rw-r--r-- | src/verify.h | 12 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/verify.cc b/src/verify.cc index fd5c45ec..a55724ba 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -533,6 +533,7 @@ static void verify_main_picture_asset(Context& context, shared_ptr<const ReelPictureAsset> reel_asset, int64_t start_frame) { auto asset = reel_asset->asset(); + auto const file = *asset->file(); if ( @@ -568,6 +569,8 @@ verify_main_picture_asset(Context& context, shared_ptr<const ReelPictureAsset> r verify_picture_details(context, reel_asset, file, start_frame); } + using VN = dcp::VerificationNote; + if (dynamic_pointer_cast<const J2KPictureAsset>(asset)) { /* Only flat/scope allowed by Bv2.1 */ if ( @@ -575,11 +578,11 @@ verify_main_picture_asset(Context& context, shared_ptr<const ReelPictureAsset> r asset->size() != Size(1998, 1080) && asset->size() != Size(4096, 1716) && asset->size() != Size(3996, 2160)) { - context.bv21_error(VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS, String::compose("%1x%2", asset->size().width, asset->size().height), file); + context.add_note(VN(VN::Type::BV21_ERROR, VN::Code::INVALID_PICTURE_SIZE_IN_PIXELS, file).set_size_in_pixels(asset->size())); } } else if (dynamic_pointer_cast<const MPEG2PictureAsset>(asset)) { if (asset->size() != Size(1920, 1080)) { - context.error(VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS, fmt::format("{}x{}", asset->size().width, asset->size().height), file); + context.add_note(VN(VN::Type::ERROR, VN::Code::INVALID_PICTURE_SIZE_IN_PIXELS, file).set_size_in_pixels(asset->size())); } } @@ -2033,7 +2036,7 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str case VerificationNote::Code::VALID_RELEASE_TERRITORY: return compose("Valid release territory %1.", note.release_territory().get()); case VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS: - return compose("The size %1 of picture asset %2 is not allowed.", note.note().get(), filename()); + return compose("The size %1x%2 of picture asset %2 is not allowed.", note.size_in_pixels()->width, note.size_in_pixels()->height, filename()); case VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K: return compose("The frame rate %1 of picture asset %2 is not allowed for 2K DCPs.", note.frame_rate()->as_string(), filename()); case VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_4K: @@ -2269,7 +2272,8 @@ dcp::operator== (dcp::VerificationNote const& a, dcp::VerificationNote const& b) a.cpl_annotation_text() == b.cpl_annotation_text() && a.guard_bits() == b.guard_bits() && a.issue_date() == b.issue_date() && - a.release_territory() == b.release_territory(); + a.release_territory() == b.release_territory() && + a.size_in_pixels() == b.size_in_pixels(); } diff --git a/src/verify.h b/src/verify.h index a7a62bb9..3fff912d 100644 --- a/src/verify.h +++ b/src/verify.h @@ -618,7 +618,8 @@ private: CPL_ANNOTATION_TEXT, GUARD_BITS, ISSUE_DATE, - RELEASE_TERRITORY + RELEASE_TERRITORY, + SIZE_IN_PIXELS }; template <class T> @@ -838,6 +839,15 @@ public: return data<std::string>(Data::RELEASE_TERRITORY); } + VerificationNote& set_size_in_pixels(dcp::Size size_in_pixels) { + _data[Data::SIZE_IN_PIXELS] = size_in_pixels; + return *this; + } + + boost::optional<dcp::Size> size_in_pixels() const { + return data<dcp::Size>(Data::SIZE_IN_PIXELS); + } + private: Type _type; Code _code; |
