diff options
Diffstat (limited to 'src/lib/image.cc')
| -rw-r--r-- | src/lib/image.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc index 5b926d77c..8e6c5717b 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -297,6 +297,15 @@ Image::crop_scale_window ( out->make_part_black (corner.x + cropped_size.width, out_size.width - cropped_size.width); } + if ( + video_range == VideoRange::VIDEO && + out_video_range == VideoRange::FULL && + av_pix_fmt_desc_get(_pixel_format)->flags & AV_PIX_FMT_FLAG_RGB + ) { + /* libswscale will not convert video range for RGB sources, so we have to do it ourselves */ + out->video_range_to_full_range (); + } + return out; } |
