Skip to content

Commit 111822e

Browse files
committed
Merge branch 'master' of github.com:SpartanJ/SOIL2
2 parents 92babf5 + cdf361f commit 111822e

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

.ecode/project_build.json

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"SOIL2-premake4": {
3+
"build": [
4+
{
5+
"args": "gmake",
6+
"command": "premake4",
7+
"working_dir": ""
8+
},
9+
{
10+
"args": "-C make/${os} -j${nproc} config=${build_type}",
11+
"command": "make",
12+
"working_dir": ""
13+
}
14+
],
15+
"build_types": [
16+
"debug",
17+
"release"
18+
],
19+
"clean": [
20+
{
21+
"args": "",
22+
"command": "",
23+
"working_dir": ""
24+
}
25+
],
26+
"config": {
27+
"clear_sys_env": false
28+
},
29+
"os": [
30+
"freebsd",
31+
"haiku",
32+
"linux",
33+
"macos",
34+
"windows"
35+
],
36+
"output_parser": {
37+
"config": {
38+
"relative_file_paths": true
39+
}
40+
},
41+
"run": [
42+
{
43+
"args": "",
44+
"command": "${project_root}/bin/soil2-test-debug",
45+
"name": "soil2-test-debug",
46+
"working_dir": "${project_root}/bin/"
47+
},
48+
{
49+
"args": "",
50+
"command": "${project_root}/bin/soil2-test",
51+
"name": "soil2-test",
52+
"working_dir": "${project_root}/bin/"
53+
}
54+
]
55+
},
56+
"SOIL2-premake5": {
57+
"build": [
58+
{
59+
"args": "gmake",
60+
"command": "premake5",
61+
"working_dir": ""
62+
},
63+
{
64+
"args": "-C make/${os} -j${nproc} config=${build_type}_${arch}",
65+
"command": "make",
66+
"working_dir": ""
67+
}
68+
],
69+
"build_types": [
70+
"debug",
71+
"release"
72+
],
73+
"clean": [
74+
{
75+
"args": "",
76+
"command": "",
77+
"working_dir": ""
78+
}
79+
],
80+
"config": {
81+
"clear_sys_env": false
82+
},
83+
"os": [
84+
"freebsd",
85+
"haiku",
86+
"linux",
87+
"macos",
88+
"windows"
89+
],
90+
"output_parser": {
91+
"config": {
92+
"relative_file_paths": true
93+
}
94+
},
95+
"run": [
96+
{
97+
"args": "",
98+
"command": "${project_root}/bin/soil2-test-debug",
99+
"name": "soil2-test-debug",
100+
"working_dir": "${project_root}/bin/"
101+
},
102+
{
103+
"args": "",
104+
"command": "${project_root}/bin/soil2-test",
105+
"name": "soil2-test",
106+
"working_dir": "${project_root}/bin/"
107+
}
108+
]
109+
}
110+
}

src/SOIL2/SOIL2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,6 +2125,10 @@ SOIL_write_image_to_memory_quality
21252125
{
21262126
save_result = stbi_write_jpg_to_func(write_to_memory, &context, width, height, channels, (const unsigned char*)data, quality);
21272127
}
2128+
else if (image_type == SOIL_SAVE_TYPE_QOI)
2129+
{
2130+
save_result = stbi_write_qoi_to_func(write_to_memory, &context, width, height, channels, (const unsigned char*)data);
2131+
}
21282132
else
21292133
{
21302134
save_result = 0;

src/SOIL2/stb_image.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,6 +1815,7 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r
18151815
int i,j;
18161816
unsigned char *good;
18171817

1818+
if (data == NULL) return data;
18181819
if (req_comp == img_n) return data;
18191820
STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
18201821

@@ -1872,6 +1873,7 @@ static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int r
18721873
int i,j;
18731874
stbi__uint16 *good;
18741875

1876+
if (data == NULL) return data;
18751877
if (req_comp == img_n) return data;
18761878
STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
18771879

0 commit comments

Comments
 (0)