diff options
Diffstat (limited to 'test')
| m--------- | test/data | 0 | ||||
| -rw-r--r-- | test/image_test.cc | 17 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/data b/test/data -Subproject f47d073d6610bdb3ae0ad9d842c4d66a6e9a16d +Subproject b5863343b9157102144f70aa4269ec03922692f diff --git a/test/image_test.cc b/test/image_test.cc index bf7effe09..9c1c7457e 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -479,3 +479,20 @@ BOOST_AUTO_TEST_CASE (make_black_test) ++N; } } + + +/** Make sure the image isn't corrupted if it is cropped too much. This can happen when a + * filler 128x128 black frame is emitted from the FFmpegDecoder and the overall crop in either direction + * is greater than 128 pixels. + */ +BOOST_AUTO_TEST_CASE (over_crop_test) +{ + shared_ptr<Image> image (new Image (AV_PIX_FMT_RGB24, dcp::Size(128, 128), true)); + image->make_black (); + shared_ptr<Image> scaled = image->crop_scale_window ( + Crop(0, 0, 128, 128), dcp::Size(1323, 565), dcp::Size(1349, 565), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, true, true + ); + string const filename = "over_crop_test.png"; + write_image (scaled, "build/test/" + filename); + check_image ("test/data/" + filename, "build/test/" + filename); +} |
