diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-08-26 20:17:17 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-08-29 18:34:06 +0200 |
| commit | a47d2f667eab2abc29c9a10a3476d0d830056062 (patch) | |
| tree | 9aa1f86688b0eba6fdabd24c951a0768887b5a8b /test | |
| parent | d371403c252203ff3f0f572bdae9b0ea95ecdb2f (diff) | |
Fix vertical alignment of subtitles in some cases (#2569).
Diffstat (limited to 'test')
| -rw-r--r-- | test/burnt_subtitle_test.cc | 31 | ||||
| m--------- | test/data | 0 |
2 files changed, 31 insertions, 0 deletions
diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc index 104cbe95c..734ac7148 100644 --- a/test/burnt_subtitle_test.cc +++ b/test/burnt_subtitle_test.cc @@ -149,3 +149,34 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_onto_dcp) check_dcp("test/data/burnt_subtitle_test_onto_dcp2", film2); #endif } + + + +/** Check positioning of some burnt subtitles from XML files */ +BOOST_AUTO_TEST_CASE(burnt_subtitle_test_position) +{ + auto check = [](string alignment) + { + auto const name = String::compose("burnt_subtitle_test_position_%1", alignment); + auto subs = content_factory(String::compose("test/data/burn_%1.xml", alignment)); + auto film = new_test_film2(name, subs); + subs[0]->text[0]->set_use(true); + subs[0]->text[0]->set_burn(true); + make_and_verify_dcp( + film, + { + dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE, + dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME, + dcp::VerificationNote::Code::MISSING_CPL_METADATA + }); + + check_dcp(String::compose("test/data/%1", name), film); + }; + + /* Should have a baseline 216 pixels from the top (0.2 * 1080) */ + check("top"); + /* Should have a baseline 756 pixels from the top ((0.5 + 0.2) * 1080) */ + check("center"); + /* Should have a baseline 864 pixels from the top ((1 - 0.2) * 1080) */ + check("bottom"); +} diff --git a/test/data b/test/data -Subproject 068d944183876d7a323ef60f80bdd4deee8218e +Subproject dab44217068e681f3bfded6a8d71a54867b1cf9 |
