LibGfx/ISOBMFF: Implement JPEG2000DefaultDisplayResolutionBox

Found e.g. in http://opf-labs.org/format-corpus/jp2k-formats/balloon.jpf
This commit is contained in:
Nico Weber 2024-03-25 21:31:31 -04:00 committed by Tim Flynn
commit b3c423e4ca
Notes: sideshowbarker 2024-07-16 22:26:05 +09:00
2 changed files with 17 additions and 0 deletions

View file

@ -130,6 +130,8 @@ ErrorOr<void> JPEG2000ResolutionBox::read_from_stream(BoxStream& stream)
switch (type) {
case BoxType::JPEG2000CaptureResolutionBox:
return TRY(JPEG2000CaptureResolutionBox::create_from_stream(stream));
case BoxType::JPEG2000DefaultDisplayResolutionBox:
return TRY(JPEG2000DefaultDisplayResolutionBox::create_from_stream(stream));
default:
return OptionalNone {};
}
@ -172,6 +174,16 @@ void JPEG2000CaptureResolutionBox::dump(String const& prepend) const
JPEG2000ResolutionSubboxBase::dump(prepend);
}
ErrorOr<void> JPEG2000DefaultDisplayResolutionBox::read_from_stream(BoxStream& stream)
{
return JPEG2000ResolutionSubboxBase::read_from_stream(stream);
}
void JPEG2000DefaultDisplayResolutionBox::dump(String const& prepend) const
{
JPEG2000ResolutionSubboxBase::dump(prepend);
}
ErrorOr<void> JPEG2000ContiguousCodestreamBox::read_from_stream(BoxStream& stream)
{
// FIXME: It's wasteful to make a copy of all the image data here. Having just a ReadonlyBytes

View file

@ -72,6 +72,11 @@ struct JPEG2000CaptureResolutionBox final : public JPEG2000ResolutionSubboxBase
BOX_SUBTYPE(JPEG2000CaptureResolutionBox);
};
// I.5.3.7.2 Default Display Resolution box
struct JPEG2000DefaultDisplayResolutionBox final : public JPEG2000ResolutionSubboxBase {
BOX_SUBTYPE(JPEG2000DefaultDisplayResolutionBox);
};
// I.5.4 Contiguous Codestream box
struct JPEG2000ContiguousCodestreamBox final : public Box {
BOX_SUBTYPE(JPEG2000ContiguousCodestreamBox);