MCPcopy Create free account
hub / github.com/Tencent/tgfx / IsJpeg

Method IsJpeg

src/core/codecs/jpeg/JpegCodec.cpp:35–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace tgfx {
34
35bool JpegCodec::IsJpeg(const std::shared_ptr<Data>& data) {
36 constexpr uint8_t jpegSig[] = {0xFF, 0xD8, 0xFF};
37 return data->size() >= 3 && !memcmp(data->bytes(), jpegSig, sizeof(jpegSig));
38}
39
40const uint32_t kExifHeaderSize = 14;
41const uint32_t kExifMarker = JPEG_APP0 + 1;

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
bytesMethod · 0.45

Tested by

no test coverage detected