Skip to content

Commit 47bff4c

Browse files
committed
Change missing pixi to be an error only in strict parsing mode
1 parent 5326af6 commit 47bff4c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

mp4parse/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,8 +1711,12 @@ pub fn read_avif<T: Read>(f: &mut T, strictness: ParseStrictness) -> Result<Avif
17111711
.map_or(false, |opt| opt.is_some())
17121712
};
17131713
if !has_pixi(primary_item_id) || !alpha_item_id.map_or(true, has_pixi) {
1714+
// The requirement to include pixi is in the process of being changed
1715+
// to allowing its omission to imply a default value. In anticipation
1716+
// of that, only give an error in strict mode
1717+
// See https://github.com/MPEGGroup/MIAF/issues/9
17141718
fail_if(
1715-
strictness != ParseStrictness::Permissive,
1719+
strictness == ParseStrictness::Strict,
17161720
"The pixel information property shall be associated with every image \
17171721
that is displayable (not hidden) \
17181722
per MIAF (ISO/IEC 23000-22:2019) specification § 7.3.6.6",

mp4parse/tests/public.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,8 @@ fn public_avif_pixi_present_for_displayable_images() {
923923
let expected_msg = "The pixel information property shall be associated with every image \
924924
that is displayable (not hidden) \
925925
per MIAF (ISO/IEC 23000-22:2019) specification § 7.3.6.6";
926-
assert_avif_shall(IMAGE_AVIF_NO_PIXI, expected_msg);
927-
assert_avif_shall(IMAGE_AVIF_NO_ALPHA_PIXI, expected_msg);
926+
assert_avif_should(IMAGE_AVIF_NO_PIXI, expected_msg);
927+
assert_avif_should(IMAGE_AVIF_NO_ALPHA_PIXI, expected_msg);
928928
}
929929

930930
#[test]

0 commit comments

Comments
 (0)