Skip to content
Myr

Merge branch 'component-ids' of https://github.com/jeremysawicki/stb into working

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parents 786ac92, 34fa37b · Browse files · 1 file+2 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−7 removed

  • other:+2 added−7 removed

1 file+2 added−7 removed

modified:stb_image.h+2 added-7 removed
2927 unmodified lines
2928 z->rgb = 0;2929 for (i=0; i < s->img_n; ++i) {2930 static unsigned char rgb[3] = { 'R', 'G', 'B' };2931 z->img_comp[i].id = stbi__get8(s);2932 if (z->img_comp[i].id != i+1) // JFIF requires2933 if (z->img_comp[i].id != i) { // some version of jpegtran outputs non-JFIF-compliant files!2934 // somethings output this (see http://fileformats.archiveteam.org/wiki/JPEG#Color_format)2935 if (z->img_comp[i].id != rgb[i])2936 return stbi__err("bad component ID","Corrupt JPEG");2937 ++z->rgb;2938 }2932 if (z->img_comp[i].id == rgb[i])2933 ++z->rgb;2934 q = stbi__get8(s);2935 z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG");2936 z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG");2937 z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG");
4107 unmodified lines