From 07515bb7fe9659973ec00da52f9be6d2004f6d70 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 2 Jan 2023 15:29:51 +0100 Subject: Fix errors when a custom size is given which is larger than the container (#2404). --- src/lib/video_content.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index c10a94f43..9b39ff01b 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -650,7 +650,10 @@ VideoContent::scaled_size (dcp::Size film_container) } if (_custom_size) { - return *_custom_size; + if (_custom_size->width <= film_container.width && _custom_size->height <= film_container.height) { + return *_custom_size; + } + return fit_ratio_within(_custom_size->ratio(), film_container); } auto size = size_after_crop (); -- cgit v1.2.3