MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / stbi__check_png_header

Function stbi__check_png_header

lite/example/cpp_example/mge/cv/stb_image.h:4977–4984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4975}
4976
4977static int stbi__check_png_header(stbi__context* s) {
4978 static const stbi_uc png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
4979 int i;
4980 for (i = 0; i < 8; ++i)
4981 if (stbi__get8(s) != png_sig[i])
4982 return stbi__err("bad png sig", "Not a PNG");
4983 return 1;
4984}
4985
4986typedef struct {
4987 stbi__context* s;

Callers 2

stbi__parse_png_fileFunction · 0.85
stbi__png_testFunction · 0.85

Calls 2

stbi__get8Function · 0.85
stbi__errFunction · 0.85

Tested by

no test coverage detected