fn dispatch_header<R: BufRead + Seek>(reader: &mut R, header: &[u8]) -> ImageResult<ImageSize> {
    match image_type(&header)? {
        ImageType::Bmp => bmp_size(reader),
        ImageType::Gif => gif_size(header),
        ImageType::Heif => heif_size(reader),
        ImageType::Jpeg => jpeg_size(reader),
        ImageType::Jxl => jxl_size(reader),
        ImageType::Png => png_size(reader),
        ImageType::Psd => psd_size(reader),
        ImageType::Tiff => tiff_size(reader),
        ImageType::Webp => webp_size(reader),
    }
}
/// Calls the correct image size method based on the image type
///
/// # Arguments
/// * `reader` - A reader for the data
/// * `header` - The header of the file
Calls the correct image size method based on the image type
Calls the correct image size method based on the image type
fn dispatch_header<R: BufRead + Seek>(reader: &mut R, header: &[u8]) -> ImageResult<ImageSize> {
    match image_type(&header)? {
        ImageType::Bmp => bmp_size(reader),
        ImageType::Gif => gif_size(header),
        ImageType::Heif => heif_size(reader),
        ImageType::Jpeg => jpeg_size(reader),
        ImageType::Jxl => jxl_size(reader),
        ImageType::Png => png_size(reader),
        ImageType::Psd => psd_size(reader),
        ImageType::Tiff => tiff_size(reader),
        ImageType::Webp => webp_size(reader),
    }
}
fn dispatch_header < R : BufRead + Seek > ( reader : & mut R , header : & [ u8 ] ) -> ImageResult < ImageSize > { match image_type ( & header ) ? { ImageType :: Bmp => bmp_size ( reader ) , ImageType :: Gif => gif_size ( header ) , ImageType :: Heif => heif_size ( reader ) , ImageType :: Jpeg => jpeg_size ( reader ) , ImageType :: Jxl => jxl_size ( reader ) , ImageType :: Png => png_size ( reader ) , ImageType :: Psd => psd_size ( reader ) , ImageType :: Tiff => tiff_size ( reader ) , ImageType :: Webp => webp_size ( reader ) , } }
Calls the correct image size method based on the image type
Calls the correct image size method based on the image type
reader
&mut R
header
&[u8]
reader
&mut R
header
&[u8]