JBIG2Loader.cpp 662 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2024, Nico Weber <thakis@chromium.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibGfx/ImageFormats/JBIG2Loader.h>
  7. // Spec: ITU-T_T_88__08_2018.pdf in the zip file here:
  8. // https://www.itu.int/rec/T-REC-T.88-201808-I
  9. namespace Gfx {
  10. bool JBIG2ImageDecoderPlugin::sniff(ReadonlyBytes data)
  11. {
  12. // JBIG2 spec, Annex D, D.4.1 ID string
  13. u8 id_string[] = { 0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A };
  14. return data.starts_with(id_string);
  15. }
  16. ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> JBIG2ImageDecoderPlugin::create(ReadonlyBytes)
  17. {
  18. return Error::from_string_view("FIXME: Draw the rest of the owl"sv);
  19. }
  20. }