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(16))?;
8
9 Ok(ImageSize {
10 width: read_u16(reader, &Endian::Little)? as usize,
11 height: read_u16(reader, &Endian::Little)? as usize,
12 })
13}
14
15pub fn matches(header: &[u8]) -> bool {
16 header.starts_with(needle:b"VTF\0")
17}
18