Skip to content
Myr

tweaks to previous merge

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 · parent 00c2545 · Browse files · 1 file+5 added−6 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+5 added−6 removed

  • other:+5 added−6 removed

1 file+5 added−6 removed

modified:stb_image.h+5 added-6 removed
1691 unmodified lines
1692 int succ_high;1693 int succ_low;1694 int eob_run;1695 int jfif;1696 int app14;1696 int app14_color_transform; // Adobe APP14 tag1697 int rgb;16981699 int scan_n, order[4];1700 int restart_interval, todo;
1160 unmodified lines
2861 for (i=0; i < 5; ++i)2862 if (stbi__get8(z->s) != tag[i])2863 ok = 0;2864 L -= 5;2865 if (ok) {2865 if (ok)2866 z->jfif = 1;2867 }2867 } else if (m == 0xEE && L >= 12) { // Adobe APP14 segment2868 static const unsigned char tag[6] = {'A','d','o','b','e','\0'};2869 int ok = 1;2870 int i;
4 unmodified lines
2875 if (ok) {2876 stbi__get8(z->s); // version2877 stbi__get16be(z->s); // flags02878 stbi__get16be(z->s); // flags12880 z->app14 = stbi__get8(z->s); // color transform2879 z->app14_color_transform = stbi__get8(z->s); // color transform2880 L -= 6;2881 }2882 }2883
161 unmodified lines
3045static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)3046{3047 int m;3048 z->jfif = 0;3050 z->app14 = -1;3049 z->app14_color_transform = -1; // valid values are 0,1,23050 z->marker = STBI__MARKER_none; // initialize cached marker to empty3051 m = stbi__get_marker(z);3052 if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG");3053 if (scan == STBI__SCAN_type) return 1;
475 unmodified lines
35293530 // determine actual number of components to generate3531 n = req_comp ? req_comp : z->s->img_n;35323534 is_rgb = z->s->img_n == 3 && (z->rgb == 3 || (z->app14 == 0 && !z->jfif));3533 is_rgb = z->s->img_n == 3 && (z->rgb == 3 || (z->app14_color_transform == 0 && !z->jfif));35343535 if (z->s->img_n == 3 && n < 3 && !is_rgb)3536 decode_n = 1;3537 else
3559 unmodified lines