3 Download images and add Newpixbots to them! (or Megans)
6 Copyright (C) 2013, 2014, 2022 Balthasar SzczepaĆski
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Affero General Public License as
10 published by the Free Software Foundation, either version 3 of the
11 License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Affero General Public License for more details.
18 You should have received a copy of the GNU Affero General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 Requires cgilib (http://www.infodrom.org/projects/cgilib/)
34 #include "online-core.h"
40 char *inpix, char *outpix,
41 uint_fast8_t remove_border, uint_fast32_t remove_border_width,
42 uint_fast8_t new_border, uint_fast32_t new_border_width,
43 uint_fast8_t external_border, uint_fast32_t external_border_width,
44 uint_fast8_t corners, uint_fast8_t ong1, uint8_t t403
47 int main (int argc, char *argv[])
54 uint_fast8_t remove_border, new_border, external_border, corners, ong1;
55 uint_fast32_t remove_border_width, new_border_width, external_border_width;
56 uint_fast8_t t403 = 0;
64 make_tmp_path(in_tmp, 256, 0, "");
65 make_tmp_path(out_tmp, 256, 1, ".png");
69 r = get_file(cgi,"inpix2", in_tmp, &in_path);
71 r = get_file(cgi,"inpix", in_tmp, &in_path);
75 remove_border = (cgiGetValue(cgi, "r")!=NULL) ? 1 : 0;
76 external_border = (cgiGetValue(cgi, "e")!=NULL) ? 1 : 0;
77 new_border = (cgiGetValue(cgi, "b")!=NULL) ? 1 : 0;
78 corners = (cgiGetValue(cgi, "c")!=NULL) ? 1 : 0;
79 ong1 = (cgiGetValue(cgi, "o")!=NULL) ? 1 : 0;
80 t403 = (cgiGetValue(cgi, "4")!=NULL) ? 1 : 0;
84 t = cgiGetValue(cgi, "rw");
86 sscanf(t,"%"SCNuFAST32, &remove_border_width);
88 remove_border_width = 0;
93 t = cgiGetValue(cgi, "ew");
95 sscanf(t,"%"SCNuFAST32, &external_border_width);
97 external_border_width = 0;
102 t = cgiGetValue(cgi, "bw");
104 sscanf(t,"%"SCNuFAST32, &new_border_width);
106 new_border_width = 0;
111 remove_border, remove_border_width,
112 new_border, new_border_width,
113 external_border, external_border_width,
119 r1 = send_file(out_tmp, "image/png", 0);
124 t403 ? mpb_503 : mpb,
125 t403 ? mpb_503_size : mpb_size,
142 char *inpix, char *outpix,
143 uint_fast8_t remove_border, uint_fast32_t remove_border_width,
144 uint_fast8_t new_border, uint_fast32_t new_border_width,
145 uint_fast8_t external_border, uint_fast32_t external_border_width,
146 uint_fast8_t corners, uint_fast8_t ong1, uint8_t t403
149 char s_rw[13] = "-0";
150 char s_bw[13] = "-0";
151 char s_ew[13] = "-0";
157 snprintf(s_rw, 13, "-r%"PRIuFAST32, remove_border_width);
159 snprintf(s_bw, 13, "-b%"PRIuFAST32, new_border_width);
161 snprintf(s_ew, 13, "-e%"PRIuFAST32, external_border_width);
169 corners ? "-c" : "-0",