Skip to content

Commit 03a07f9

Browse files
authored
Merge pull request #46 from AllenDang/master
Fix size reader for ktx2 and the test case, original code always retu…
2 parents 672f2a6 + 45a4f63 commit 03a07f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/formats/ktx2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::{
66
};
77

88
pub fn size<R: BufRead + Seek>(reader: &mut R) -> ImageResult<ImageSize> {
9-
reader.seek(SeekFrom::Start(16))?;
9+
reader.seek(SeekFrom::Start(20))?;
1010

1111
let width = read_u32(reader, &Endian::Little)? as usize;
1212
let height = read_u32(reader, &Endian::Little)? as usize;

tests/ktx2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn ktx2_test() {
88
assert_eq!(
99
dim,
1010
ImageSize {
11-
width: 1,
11+
width: 256,
1212
height: 256
1313
}
1414
);

0 commit comments

Comments
 (0)