1use crate::util::*;
2use crate::{ImageResult, ImageSize};
3
4use std::io::{BufRead, Seek, SeekFrom};
5
6pub fn size<R: BufRead + Seek>(reader: &mut R) -> ImageResult<ImageSize> {
7 reader.seek(pos:SeekFrom::Start(0x0E))?;
8
9 Ok(ImageSize {
10 height: read_u32(reader, &Endian::Big)? as usize,
11 width: read_u32(reader, &Endian::Big)? as usize,
12 })
13}
14
15pub fn matches(header: &[u8]) -> bool {
16 header.starts_with(needle:b"8BPS")
17}
18