X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.cc;h=78ed8da99f9e1a2e0ddfe3ea416c4d8296fd6702;hb=969906f2dd6c5c144781861f53e2a0f6baefb9a3;hp=981cfa521eda35957eec466f8225f510f9c11506;hpb=3799e91d126d243d41c44dcb0ca1bfa66b53a57e;p=dcpomatic.git diff --git a/src/lib/util.cc b/src/lib/util.cc index 981cfa521..78ed8da99 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -957,7 +957,7 @@ emit_subtitle_image (ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size { /* XXX: this is rather inefficient; decoding the image just to get its size */ FFmpegImageProxy proxy (sub.png_image()); - auto image = proxy.image(Image::Alignment::COMPACT).image; + auto image = proxy.image(Image::Alignment::PADDED).image; /* set up rect with height and width */ dcpomatic::Rect rect(0, 0, image->size().width / double(size.width), image->size().height / double(size.height)); @@ -1111,7 +1111,7 @@ linear_to_db (double linear) dcp::Size -scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container) +scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container, PixelQuanta quanta) { /* Now scale it down if the display container is smaller than the film container */ if (display_container != film_container) { @@ -1122,6 +1122,7 @@ scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_cont s.width = lrintf (s.width * scale); s.height = lrintf (s.height * scale); + s = quanta.round (s); } return s;