pub fn scale(
        &mut self,
        requested_width: u16,
        requested_height: u16,
    ) -> ImageResult<(u16, u16)> {
        let result = self
            .decoder
            .scale(requested_width, requested_height)
            .map_err(jpeg_error_to_image_error)?;

        self.metadata.width = result.0;
        self.metadata.height = result.1;

        Ok(result)
    }
/// Configure the decoder to scale the image during decoding.
///
/// This efficiently scales the image by the smallest supported
/// scale factor that produces an image larger than or equal to
/// the requested size in at least one axis. The currently
/// implemented scale factors are 1/8, 1/4, 1/2 and 1.
///
/// To generate a thumbnail of an exact size, pass the desired
/// size and then scale to the final size using a traditional
/// resampling algorithm.
///
/// The size of the image to be loaded, with the scale factor
/// applied, is returned.
Configure the decoder to scale the image during decoding.
This efficiently scales the image by the smallest supported
scale factor that produces an image larger than or equal to
the requested size in at least one axis. The currently
implemented scale factors are 1/8, 1/4, 1/2 and 1.

To generate a thumbnail of an exact size, pass the desired
size and then scale to the final size using a traditional
resampling algorithm.

The size of the image to be loaded, with the scale factor
applied, is returned.
Configure the decoder to scale the image during decoding . This efficiently scales the image by the smallest supported scale factor that produces an image larger than or equal to the requested size in at least one axis . The currently implemented scale factors are 1 / 8 1 / 4 1 / 2 and 1 . To generate a thumbnail of an exact size pass the desired size and then scale to the final size using a traditional resampling algorithm . The size of the image to be loaded with the scale factor applied is returned .
pub fn scale(
        &mut self,
        requested_width: u16,
        requested_height: u16,
    ) -> ImageResult<(u16, u16)> {
        let result = self
            .decoder
            .scale(requested_width, requested_height)
            .map_err(jpeg_error_to_image_error)?;
        self.metadata.width = result.0;
        self.metadata.height = result.1;
        Ok(result)
    }
pub fn scale ( & mut self , requested_width : u16 , requested_height : u16 , ) -> ImageResult < ( u16 , u16 ) > { let result = self . decoder . scale ( requested_width , requested_height ) . map_err ( jpeg_error_to_image_error ) ? ; self . metadata . width = result . 0 ; self . metadata . height = result . 1 ; Ok ( result ) }
Configure the decoder to scale the image during decoding.
Configure the decoder to scale the image during decoding .
&mut self
requested_width
u16
requested_height
u16