Have non-animated image decoders give EOD earlier

This commit is contained in:
Nigel Tao committed 2020-12-19 22:03:22 +11:00
1 parent 4a8acf968b
commit 9399c82409
5 files changed
+7 -457

No files matched your search

+1 -13
View File
@@ -102,7 +102,7 @@ pub func decoder.decode_frame_config?(dst: nptr base.frame_config, src: base.io_
return base."#bad restart"
}
} else if this.call_sequence == 2 {
this.skip_frame?(src: args.src)
this.call_sequence = 3
return base."@end of data"
} else {
return base."@end of data"
@@ -224,18 +224,6 @@ pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader,
this.call_sequence = 3
}
pri func decoder.skip_frame?(src: base.io_reader) {
var bytes_per_row : base.u64[..= 0x2000_0000]
var total_bytes : base.u64
bytes_per_row = ((this.width as base.u64) + 7) / 8
total_bytes = bytes_per_row * (this.height as base.u64)
args.src.skip?(n: total_bytes)
this.call_sequence = 3
}
pub func decoder.frame_dirty_rect() base.rect_ie_u32 {
return this.util.make_rect_ie_u32(
min_incl_x: 0,