Skip to content

Commit

Permalink
flag internal interface redone now, progressive bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Benes committed Nov 20, 2023
1 parent 6621e18 commit 533cf91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/jpeglib/_bind.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def flags_to_mask(
# progressive mode
if progressive_mode is not None:
mask_overwrite ^= cls.MASKS['PROGRESSIVE_MODE']
if progressive_mode:
if progressive_mode is False:
mask_set_value ^= cls.MASKS['PROGRESSIVE_MODE']

# manual flags
Expand Down Expand Up @@ -351,9 +351,7 @@ def flags_to_mask(
def mask_to_flags(cls, mask: int):
flags = []
bitmask = mask[0]
# PROGRESSIVE_MODE = 0b00100
# mask = ??1?? or ??0??
if ((cls.MASKS["PROGRESSIVE_MODE"]) & bitmask) != 0:
if (bitmask & cls.MASKS["PROGRESSIVE_MODE"]) != 0:
flags.append("PROGRESSIVE_MODE")

return flags
Expand Down
2 changes: 2 additions & 0 deletions src/jpeglib/cjpeglib/cjpeglib_common_flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ boolean overwrite_default(
return ((flags & mask) != 0);
}

// TODO: merge?

#ifdef __cplusplus
}
#endif

0 comments on commit 533cf91

Please sign in to comment.