fn resize(
        image: &ImageBuffer<Rgba<u8>, Vec<u8>>,
        t_width: u32,
        image_h: u32,
    ) -> ImageBuffer<Rgba<u8>, Vec<u8>> {
        // rounding up because ffmpeg doesnt
        // play well with non-even numbers in resolutions
        let image_h = if image_h % 2 == 0 {
            image_h
        } else {
            image_h + 1
        };
        image::imageops::resize(
            image,
            Self::npercent(image.width(), t_width),
            image_h as _,
            image::imageops::FilterType::Gaussian,
        )
    }
/// Resizes the supplied image to a given width.
///
/// Captions cannot exceed the width of the input media, which is why
/// the caption image needs to be resized to fit the width accordingly.
///
/// This operation preserves aspect ratio.
Resizes the supplied image to a given width.
Captions cannot exceed the width of the input media, which is why
the caption image needs to be resized to fit the width accordingly.

This operation preserves aspect ratio.
Resizes the supplied image to a given width . Captions cannot exceed the width of the input media which is why the caption image needs to be resized to fit the width accordingly . This operation preserves aspect ratio .
fn resize(
        image: &ImageBuffer<Rgba<u8>, Vec<u8>>,
        t_width: u32,
        image_h: u32,
    ) -> ImageBuffer<Rgba<u8>, Vec<u8>> {
        // rounding up because ffmpeg doesnt
        // play well with non-even numbers in resolutions
        let image_h = if image_h % 2 == 0 {
            image_h
        } else {
            image_h + 1
        };
        image::imageops::resize(
            image,
            Self::npercent(image.width(), t_width),
            image_h as _,
            image::imageops::FilterType::Gaussian,
        )
    }
fn resize ( image : & ImageBuffer < Rgba < u8 > , Vec < u8 > > , t_width : u32 , image_h : u32 , ) -> ImageBuffer < Rgba < u8 > , Vec < u8 > > { // rounding up because ffmpeg doesnt // play well with non-even numbers in resolutions let image_h = if image_h % 2 == 0 { image_h } else { image_h + 1 } ; image :: imageops :: resize ( image , Self :: npercent ( image . width ( ) , t_width ) , image_h as _ , image :: imageops :: FilterType :: Gaussian , ) }
Resizes the supplied image to a given width.
Resizes the supplied image to a given width .
image
&ImageBuffer<Rgba<u8>, Vec<u8>>
t_width
u32
image_h
u32
image
&ImageBuffer<Rgba<u8>, Vec<u8>>
t_width
u32
image_h
u32