@@ -35,7 +35,7 @@ use crate::image::{GenericImage, GenericImageView, ImageDecoder, ImageFormat, Im
35
35
use crate :: image:: ImageEncoder ;
36
36
use crate :: io:: free_functions;
37
37
use crate :: imageops;
38
- use crate :: math:: resize_dimensions ;
38
+ use crate :: math;
39
39
use crate :: traits:: Pixel ;
40
40
41
41
/// A Dynamic Image
@@ -756,7 +756,7 @@ impl DynamicImage {
756
756
/// within the bounds specified by ```nwidth``` and ```nheight```.
757
757
pub fn resize ( & self , nwidth : u32 , nheight : u32 , filter : imageops:: FilterType ) -> DynamicImage {
758
758
let ( width2, height2) =
759
- resize_dimensions ( self . width ( ) , self . height ( ) , nwidth, nheight, false ) ;
759
+ math :: resize_to_fit ( ( self . width ( ) , self . height ( ) ) , ( nwidth, nheight) ) ;
760
760
761
761
self . resize_exact ( width2, height2, filter)
762
762
}
@@ -783,7 +783,7 @@ impl DynamicImage {
783
783
/// May give aliasing artifacts if new size is close to old size.
784
784
pub fn thumbnail ( & self , nwidth : u32 , nheight : u32 ) -> DynamicImage {
785
785
let ( width2, height2) =
786
- resize_dimensions ( self . width ( ) , self . height ( ) , nwidth, nheight, false ) ;
786
+ math :: resize_to_fit ( ( self . width ( ) , self . height ( ) ) , ( nwidth, nheight) ) ;
787
787
self . thumbnail_exact ( width2, height2)
788
788
}
789
789
@@ -810,7 +810,7 @@ impl DynamicImage {
810
810
filter : imageops:: FilterType ,
811
811
) -> DynamicImage {
812
812
let ( width2, height2) =
813
- resize_dimensions ( self . width ( ) , self . height ( ) , nwidth, nheight, true ) ;
813
+ math :: resize_to_fill ( ( self . width ( ) , self . height ( ) ) , ( nwidth, nheight) ) ;
814
814
815
815
let mut intermediate = self . resize_exact ( width2, height2, filter) ;
816
816
let ( iwidth, iheight) = intermediate. dimensions ( ) ;
0 commit comments