diff --git a/Userland/Libraries/LibGfx/ImageFormats/ISOBMFF/JPEG2000Boxes.cpp b/Userland/Libraries/LibGfx/ImageFormats/ISOBMFF/JPEG2000Boxes.cpp index 122c290f47f..49bb2700fdb 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/ISOBMFF/JPEG2000Boxes.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/ISOBMFF/JPEG2000Boxes.cpp @@ -17,6 +17,8 @@ ErrorOr JPEG2000HeaderBox::read_from_stream(BoxStream& stream) return TRY(JPEG2000ColorSpecificationBox::create_from_stream(stream)); case BoxType::JPEG2000ImageHeaderBox: return TRY(JPEG2000ImageHeaderBox::create_from_stream(stream)); + case BoxType::JPEG2000ResolutionBox: + return TRY(JPEG2000ResolutionBox::create_from_stream(stream)); default: return OptionalNone {}; } @@ -87,6 +89,24 @@ void JPEG2000ColorSpecificationBox::dump(String const& prepend) const outln("{}- icc_data = {} bytes", prepend, icc_data.size()); } +ErrorOr JPEG2000ResolutionBox::read_from_stream(BoxStream& stream) +{ + auto make_subbox = [](BoxType type, BoxStream&) -> ErrorOr>> { + switch (type) { + default: + return OptionalNone {}; + } + }; + + TRY(SuperBox::read_from_stream(stream, move(make_subbox))); + return {}; +} + +void JPEG2000ResolutionBox::dump(String const& prepend) const +{ + SuperBox::dump(prepend); +} + ErrorOr JPEG2000SignatureBox::read_from_stream(BoxStream& stream) { signature = TRY(stream.read_value>()); diff --git a/Userland/Libraries/LibGfx/ImageFormats/ISOBMFF/JPEG2000Boxes.h b/Userland/Libraries/LibGfx/ImageFormats/ISOBMFF/JPEG2000Boxes.h index 0a625dba10d..f42aa58f5ab 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/ISOBMFF/JPEG2000Boxes.h +++ b/Userland/Libraries/LibGfx/ImageFormats/ISOBMFF/JPEG2000Boxes.h @@ -38,6 +38,11 @@ struct JPEG2000ColorSpecificationBox final : public Box { ByteBuffer icc_data; // Only set if method == 2 }; +// I.5.3.7 Resolution box +struct JPEG2000ResolutionBox final : public SuperBox { + BOX_SUBTYPE(JPEG2000ResolutionBox); +}; + struct JPEG2000SignatureBox final : public Box { BOX_SUBTYPE(JPEG2000SignatureBox);