calculate_target_dimensions

Function calculate_target_dimensions 

Source
pub fn calculate_target_dimensions(
    image_width: u32,
    image_height: u32,
    display_width: u32,
    display_height: u32,
) -> Option<(u32, u32)>
Expand description

Calculate optimal target dimensions for decoding based on display size. Returns None if no resizing is needed (image is smaller than display).

This helps reduce memory usage by decoding large images at a resolution appropriate for the display, rather than always using full resolution.