summaryrefslogtreecommitdiff
path: root/test/create_cli_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-04-16 22:05:24 +0200
committerCarl Hetherington <cth@carlh.net>2026-04-16 22:05:24 +0200
commit9bbd8891f9d043fd96a565c74016ee29143899cc (patch)
tree98185ef6bd15fd40cc223e01fd1956c63f627b18 /test/create_cli_test.cc
parent2fc3908ca3d7a01aee43db7e28f99fb6ec553a68 (diff)
Add --fill-crop to create CLI (#3008).
This can be used to extract images from letterboxed/pillarboxed frames.
Diffstat (limited to 'test/create_cli_test.cc')
-rw-r--r--test/create_cli_test.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/create_cli_test.cc b/test/create_cli_test.cc
index c71031fbc..0f127c018 100644
--- a/test/create_cli_test.cc
+++ b/test/create_cli_test.cc
@@ -322,6 +322,22 @@ BOOST_AUTO_TEST_CASE (create_cli_test)
BOOST_CHECK(film->content()[0]->video->fade_in() == 24);
BOOST_CHECK(film->content()[0]->video->fade_out() == 0);
BOOST_CHECK(collected_error.empty());
+
+ /* Extract a 1.85 frame from a 320x240 source */
+ cc = run("dcpomatic2_create --container-ratio 185 --fill-crop test/data/red_24.mp4");
+ BOOST_CHECK(!cc.error);
+ film = cc.make_film(error);
+ BOOST_REQUIRE_EQUAL(film->content().size(), 1U);
+ BOOST_REQUIRE(film->content()[0]->video);
+ BOOST_CHECK(film->content()[0]->video->requested_crop() == Crop(0, 0, 33, 33));
+
+ /* Extract a 1.85 frame from a 2048x858 source */
+ cc = run("dcpomatic2_create --container-ratio 185 --fill-crop test/data/scope_dcp");
+ BOOST_CHECK(!cc.error);
+ film = cc.make_film(error);
+ BOOST_REQUIRE_EQUAL(film->content().size(), 1U);
+ BOOST_REQUIRE(film->content()[0]->video);
+ BOOST_CHECK(film->content()[0]->video->requested_crop() == Crop(230, 230, 0, 0));
}