diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/verify.cc | 17 | ||||
| -rw-r--r-- | src/verify.h | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/verify.cc b/src/verify.cc index 3c36e8f6..428c737f 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -666,6 +666,21 @@ verify_subtitle_asset ( ) ); } + /* XXX: I'm not sure what Bv2.1_7.2.1 means when it says "the font resource shall not be larger than 10MB" + * but I'm hoping that checking for the total size of all fonts being <= 10MB will do. + */ + map<string, ArrayData> fonts = asset->font_data (); + int total_size = 0; + for (map<string, ArrayData>::const_iterator i = fonts.begin(); i != fonts.end(); ++i) { + total_size += i->second.size(); + } + if (total_size > 10 * 1024 * 1024) { + notes.push_back ( + VerificationNote( + VerificationNote::VERIFY_BV21_ERROR, VerificationNote::TIMED_TEXT_FONTS_TOO_LARGE_IN_BYTES, *asset->file() + ) + ); + } } } @@ -866,6 +881,8 @@ dcp::note_to_string (dcp::VerificationNote note) return String::compose("The XML for the closed caption asset %1 is longer than the 256KB maximum required by Bv2.1", note.file()->filename()); case dcp::VerificationNote::TIMED_TEXT_ASSET_TOO_LARGE_IN_BYTES: return String::compose("The total size of the timed text asset %1 is larger than the 115MB maximum required by Bv2.1", note.file()->filename()); + case dcp::VerificationNote::TIMED_TEXT_FONTS_TOO_LARGE_IN_BYTES: + return String::compose("The total size of the fonts in timed text asset %1 is larger than the 10MB maximum required by Bv2.1", note.file()->filename()); } return ""; diff --git a/src/verify.h b/src/verify.h index 3b5dafac..c30718eb 100644 --- a/src/verify.h +++ b/src/verify.h @@ -106,6 +106,8 @@ public: CLOSED_CAPTION_XML_TOO_LARGE_IN_BYTES, /** Any timed text asset's total files is larger than 115MB [Bv2.1_7.2.1] */ TIMED_TEXT_ASSET_TOO_LARGE_IN_BYTES, + /** The total size of all a timed text asset's fonts is larger than 10MB [Bv2.1_7.2.1] */ + TIMED_TEXT_FONTS_TOO_LARGE_IN_BYTES, }; VerificationNote (Type type, Code code) |
