mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-17 16:32:11 +01:00
Fix gif metadata when skipping decode_image_config
This commit is contained in:
1 parent
8feb2709fa
commit
ebe080c9ec
2 files changed
+2
-9
No files matched your search
@@ -8171,7 +8171,6 @@ struct wuffs_gif__decoder__struct {
|
||||
uint32_t f_width;
|
||||
uint32_t f_height;
|
||||
uint8_t f_call_sequence;
|
||||
bool f_ignore_metadata;
|
||||
bool f_report_metadata_iccp;
|
||||
bool f_report_metadata_xmp;
|
||||
uint32_t f_metadata_fourcc;
|
||||
@@ -31784,7 +31783,6 @@ wuffs_gif__decoder__decode_frame_config(
|
||||
switch (coro_susp_point) {
|
||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_0;
|
||||
|
||||
self->private_impl.f_ignore_metadata = true;
|
||||
self->private_impl.f_dirty_max_excl_y = 0;
|
||||
if ((self->private_impl.f_call_sequence & 16) != 0) {
|
||||
status = wuffs_base__make_status(wuffs_base__error__bad_call_sequence);
|
||||
@@ -32032,7 +32030,6 @@ wuffs_gif__decoder__decode_frame(
|
||||
switch (coro_susp_point) {
|
||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_0;
|
||||
|
||||
self->private_impl.f_ignore_metadata = true;
|
||||
if (self->private_impl.f_call_sequence == 64) {
|
||||
} else if (self->private_impl.f_call_sequence < 64) {
|
||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
|
||||
@@ -32796,7 +32793,7 @@ wuffs_gif__decoder__decode_ae(
|
||||
if ((0 < self->private_impl.f_num_animation_loops_value) && (self->private_impl.f_num_animation_loops_value <= 65535)) {
|
||||
self->private_impl.f_num_animation_loops_value += 1;
|
||||
}
|
||||
} else if (self->private_impl.f_ignore_metadata) {
|
||||
} else if (self->private_impl.f_call_sequence >= 32) {
|
||||
} else if (v_is_iccp && self->private_impl.f_report_metadata_iccp) {
|
||||
self->private_impl.f_metadata_fourcc = 1229144912;
|
||||
self->private_impl.f_metadata_io_position = wuffs_base__u64__sat_add((a_src ? a_src->meta.pos : 0), ((uint64_t)(iop_a_src - io0_a_src)));
|
||||
|
||||
@@ -25,7 +25,6 @@ pub struct decoder? implements base.image_decoder(
|
||||
// though it's conceptually part of the first decode_frame_config.
|
||||
call_sequence : base.u8,
|
||||
|
||||
ignore_metadata : base.bool,
|
||||
report_metadata_iccp : base.bool,
|
||||
report_metadata_xmp : base.bool,
|
||||
metadata_fourcc : base.u32,
|
||||
@@ -300,8 +299,6 @@ pub func decoder.decode_frame_config?(dst: nptr base.frame_config, src: base.io_
|
||||
var background_color : base.u32
|
||||
var flags : base.u8
|
||||
|
||||
this.ignore_metadata = true
|
||||
|
||||
this.dirty_max_excl_y = 0
|
||||
|
||||
if (this.call_sequence & 0x10) <> 0 {
|
||||
@@ -402,7 +399,6 @@ pri func decoder.skip_frame?(src: base.io_reader) {
|
||||
|
||||
// TODO: honor args.opts.
|
||||
pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader, blend: base.pixel_blend, workbuf: slice base.u8, opts: nptr base.decode_frame_options) {
|
||||
this.ignore_metadata = true
|
||||
if this.call_sequence == 0x40 {
|
||||
// No-op.
|
||||
} else if this.call_sequence < 0x40 {
|
||||
@@ -664,7 +660,7 @@ pri func decoder.decode_ae?(src: base.io_reader) {
|
||||
this.num_animation_loops_value += 1
|
||||
}
|
||||
|
||||
} else if this.ignore_metadata {
|
||||
} else if this.call_sequence >= 0x20 {
|
||||
// No-op.
|
||||
|
||||
} else if is_iccp and this.report_metadata_iccp {
|
||||
|
||||
Reference in new issue
Block a user