Taka005
commited on
Commit
·
fc2ade5
1
Parent(s):
3a6fc62
tag削除
Browse files
README.md
CHANGED
@@ -11,7 +11,6 @@
|
|
11 |
- `/reverseWhite` 色反転・アイコンの位置反転
|
12 |
## パラメーター
|
13 |
- name: 名前
|
14 |
-
- tag: 4桁のID
|
15 |
- id: ID
|
16 |
- content: 内容
|
17 |
- icon: アイコン
|
|
|
11 |
- `/reverseWhite` 色反転・アイコンの位置反転
|
12 |
## パラメーター
|
13 |
- name: 名前
|
|
|
14 |
- id: ID
|
15 |
- content: 内容
|
16 |
- icon: アイコン
|
a.png
DELETED
Binary file (2.81 kB)
|
|
main.py
CHANGED
@@ -80,7 +80,7 @@ def drawText(im, ofs, string, font="fonts/MPLUSRounded1c-Regular.ttf", size=16,
|
|
80 |
|
81 |
return (0, dy, real_y)
|
82 |
|
83 |
-
def make(name,
|
84 |
img = BASE_IMAGE.copy()
|
85 |
|
86 |
icon = Image.open(io.BytesIO(requests.get(icon).content))
|
@@ -96,7 +96,7 @@ def make(name, tag, id, content, icon):
|
|
96 |
tsize_t = drawText(img, (890, 270), content, size=45, color=(255, 255, 255, 255), split_len=16, auto_expand=True)
|
97 |
|
98 |
name_y = tsize_t[2] + 40
|
99 |
-
tsize_name = drawText(img, (890, name_y), f"{name}
|
100 |
|
101 |
id_y = name_y + tsize_name[1] + 4
|
102 |
tsize_id = drawText(img, (890, id_y), id, size=18, color=(180, 180, 180, 255), split_len=45, disable_dot_wrap=True)
|
@@ -108,7 +108,7 @@ def make(name, tag, id, content, icon):
|
|
108 |
file.seek(0)
|
109 |
return file
|
110 |
|
111 |
-
def colorMake(name,
|
112 |
img = BASE_IMAGE.copy()
|
113 |
|
114 |
icon = Image.open(io.BytesIO(requests.get(icon).content))
|
@@ -122,7 +122,7 @@ def colorMake(name, tag, id, content, icon):
|
|
122 |
tsize_t = drawText(img, (890, 270), content, size=45, color=(255, 255, 255, 255), split_len=16, auto_expand=True)
|
123 |
|
124 |
name_y = tsize_t[2] + 40
|
125 |
-
tsize_name = drawText(img, (890, name_y), f"{name}
|
126 |
|
127 |
id_y = name_y + tsize_name[1] + 4
|
128 |
tsize_id = drawText(img, (890, id_y), id, size=18, color=(180, 180, 180, 255), split_len=45, disable_dot_wrap=True)
|
@@ -134,7 +134,7 @@ def colorMake(name, tag, id, content, icon):
|
|
134 |
file.seek(0)
|
135 |
return file
|
136 |
|
137 |
-
def reverseMake(name,
|
138 |
img = BASE_IMAGE.copy()
|
139 |
|
140 |
icon = Image.open(io.BytesIO(requests.get(icon).content))
|
@@ -150,7 +150,7 @@ def reverseMake(name, tag, id, content, icon):
|
|
150 |
tsize_t = drawText(img, (390, 270), content, size=45, color=(255, 255, 255, 255), split_len=16, auto_expand=True)
|
151 |
|
152 |
name_y = tsize_t[2] + 40
|
153 |
-
tsize_name = drawText(img, (390, name_y), f"{name}
|
154 |
|
155 |
id_y = name_y + tsize_name[1] + 4
|
156 |
tsize_id = drawText(img, (390, id_y), id, size=18, color=(180, 180, 180, 255), split_len=45, disable_dot_wrap=True)
|
@@ -162,7 +162,7 @@ def reverseMake(name, tag, id, content, icon):
|
|
162 |
file.seek(0)
|
163 |
return file
|
164 |
|
165 |
-
def whiteMake(name,
|
166 |
img = BASE_IMAGE.copy()
|
167 |
|
168 |
icon = Image.open(io.BytesIO(requests.get(icon).content))
|
@@ -176,7 +176,7 @@ def whiteMake(name, tag, id, content, icon):
|
|
176 |
tsize_t = drawText(img, (890, 270), content, size=45, color=(0, 0, 0, 0), split_len=16, auto_expand=True)
|
177 |
|
178 |
name_y = tsize_t[2] + 40
|
179 |
-
tsize_name = drawText(img, (890, name_y), f"{name}
|
180 |
|
181 |
id_y = name_y + tsize_name[1] + 4
|
182 |
tsize_id = drawText(img, (890, id_y), id, size=18, color=(90, 90, 90, 255), split_len=45, disable_dot_wrap=True)
|
@@ -188,7 +188,7 @@ def whiteMake(name, tag, id, content, icon):
|
|
188 |
file.seek(0)
|
189 |
return file
|
190 |
|
191 |
-
def reverseWhiteMake(name,
|
192 |
img = BASE_IMAGE.copy()
|
193 |
|
194 |
icon = Image.open(io.BytesIO(requests.get(icon).content))
|
@@ -202,7 +202,7 @@ def reverseWhiteMake(name, tag, id, content, icon):
|
|
202 |
tsize_t = drawText(img, (390, 270), content, size=45, color=(0, 0, 0, 0), split_len=16, auto_expand=True)
|
203 |
|
204 |
name_y = tsize_t[2] + 40
|
205 |
-
tsize_name = drawText(img, (390, name_y), f"{name}
|
206 |
|
207 |
id_y = name_y + tsize_name[1] + 4
|
208 |
tsize_id = drawText(img, (390, id_y), id, size=18, color=(90, 90, 90, 255), split_len=45, disable_dot_wrap=True)
|
@@ -220,7 +220,6 @@ app = Flask(__name__)
|
|
220 |
def main():
|
221 |
res = make(
|
222 |
request.args.get("name") or "SAMPLE",
|
223 |
-
request.args.get("tag") or "1234",
|
224 |
request.args.get("id") or "0000000000000000000",
|
225 |
request.args.get("content") or "Make it a Quote",
|
226 |
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
@@ -231,7 +230,6 @@ def main():
|
|
231 |
def color():
|
232 |
res = colorMake(
|
233 |
request.args.get("name") or "SAMPLE",
|
234 |
-
request.args.get("tag") or "1234",
|
235 |
request.args.get("id") or "0000000000000000000",
|
236 |
request.args.get("content") or "Make it a Quote",
|
237 |
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
@@ -242,7 +240,6 @@ def color():
|
|
242 |
def reverse():
|
243 |
res = reverseMake(
|
244 |
request.args.get("name") or "SAMPLE",
|
245 |
-
request.args.get("tag") or "1234",
|
246 |
request.args.get("id") or "0000000000000000000",
|
247 |
request.args.get("content") or "Make it a Quote",
|
248 |
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
@@ -253,7 +250,6 @@ def reverse():
|
|
253 |
def white():
|
254 |
res = whiteMake(
|
255 |
request.args.get("name") or "SAMPLE",
|
256 |
-
request.args.get("tag") or "1234",
|
257 |
request.args.get("id") or "0000000000000000000",
|
258 |
request.args.get("content") or "Make it a Quote",
|
259 |
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
@@ -264,7 +260,6 @@ def white():
|
|
264 |
def reverseWhite():
|
265 |
res = reverseWhiteMake(
|
266 |
request.args.get("name") or "SAMPLE",
|
267 |
-
request.args.get("tag") or "1234",
|
268 |
request.args.get("id") or "0000000000000000000",
|
269 |
request.args.get("content") or "Make it a Quote",
|
270 |
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
|
|
80 |
|
81 |
return (0, dy, real_y)
|
82 |
|
83 |
+
def make(name, id, content, icon):
|
84 |
img = BASE_IMAGE.copy()
|
85 |
|
86 |
icon = Image.open(io.BytesIO(requests.get(icon).content))
|
|
|
96 |
tsize_t = drawText(img, (890, 270), content, size=45, color=(255, 255, 255, 255), split_len=16, auto_expand=True)
|
97 |
|
98 |
name_y = tsize_t[2] + 40
|
99 |
+
tsize_name = drawText(img, (890, name_y), f"@{name}", size=25, color=(255, 255, 255, 255), split_len=25, disable_dot_wrap=True)
|
100 |
|
101 |
id_y = name_y + tsize_name[1] + 4
|
102 |
tsize_id = drawText(img, (890, id_y), id, size=18, color=(180, 180, 180, 255), split_len=45, disable_dot_wrap=True)
|
|
|
108 |
file.seek(0)
|
109 |
return file
|
110 |
|
111 |
+
def colorMake(name, id, content, icon):
|
112 |
img = BASE_IMAGE.copy()
|
113 |
|
114 |
icon = Image.open(io.BytesIO(requests.get(icon).content))
|
|
|
122 |
tsize_t = drawText(img, (890, 270), content, size=45, color=(255, 255, 255, 255), split_len=16, auto_expand=True)
|
123 |
|
124 |
name_y = tsize_t[2] + 40
|
125 |
+
tsize_name = drawText(img, (890, name_y), f"@{name}", size=25, color=(255, 255, 255, 255), split_len=25, disable_dot_wrap=True)
|
126 |
|
127 |
id_y = name_y + tsize_name[1] + 4
|
128 |
tsize_id = drawText(img, (890, id_y), id, size=18, color=(180, 180, 180, 255), split_len=45, disable_dot_wrap=True)
|
|
|
134 |
file.seek(0)
|
135 |
return file
|
136 |
|
137 |
+
def reverseMake(name, id, content, icon):
|
138 |
img = BASE_IMAGE.copy()
|
139 |
|
140 |
icon = Image.open(io.BytesIO(requests.get(icon).content))
|
|
|
150 |
tsize_t = drawText(img, (390, 270), content, size=45, color=(255, 255, 255, 255), split_len=16, auto_expand=True)
|
151 |
|
152 |
name_y = tsize_t[2] + 40
|
153 |
+
tsize_name = drawText(img, (390, name_y), f"@{name}", size=25, color=(255, 255, 255, 255), split_len=25, disable_dot_wrap=True)
|
154 |
|
155 |
id_y = name_y + tsize_name[1] + 4
|
156 |
tsize_id = drawText(img, (390, id_y), id, size=18, color=(180, 180, 180, 255), split_len=45, disable_dot_wrap=True)
|
|
|
162 |
file.seek(0)
|
163 |
return file
|
164 |
|
165 |
+
def whiteMake(name, id, content, icon):
|
166 |
img = BASE_IMAGE.copy()
|
167 |
|
168 |
icon = Image.open(io.BytesIO(requests.get(icon).content))
|
|
|
176 |
tsize_t = drawText(img, (890, 270), content, size=45, color=(0, 0, 0, 0), split_len=16, auto_expand=True)
|
177 |
|
178 |
name_y = tsize_t[2] + 40
|
179 |
+
tsize_name = drawText(img, (890, name_y), f"@{name}", size=25, color=(0, 0, 0, 0), split_len=25, disable_dot_wrap=True)
|
180 |
|
181 |
id_y = name_y + tsize_name[1] + 4
|
182 |
tsize_id = drawText(img, (890, id_y), id, size=18, color=(90, 90, 90, 255), split_len=45, disable_dot_wrap=True)
|
|
|
188 |
file.seek(0)
|
189 |
return file
|
190 |
|
191 |
+
def reverseWhiteMake(name, id, content, icon):
|
192 |
img = BASE_IMAGE.copy()
|
193 |
|
194 |
icon = Image.open(io.BytesIO(requests.get(icon).content))
|
|
|
202 |
tsize_t = drawText(img, (390, 270), content, size=45, color=(0, 0, 0, 0), split_len=16, auto_expand=True)
|
203 |
|
204 |
name_y = tsize_t[2] + 40
|
205 |
+
tsize_name = drawText(img, (390, name_y), f"@{name}", size=25, color=(0, 0, 0, 0), split_len=25, disable_dot_wrap=True)
|
206 |
|
207 |
id_y = name_y + tsize_name[1] + 4
|
208 |
tsize_id = drawText(img, (390, id_y), id, size=18, color=(90, 90, 90, 255), split_len=45, disable_dot_wrap=True)
|
|
|
220 |
def main():
|
221 |
res = make(
|
222 |
request.args.get("name") or "SAMPLE",
|
|
|
223 |
request.args.get("id") or "0000000000000000000",
|
224 |
request.args.get("content") or "Make it a Quote",
|
225 |
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
|
|
230 |
def color():
|
231 |
res = colorMake(
|
232 |
request.args.get("name") or "SAMPLE",
|
|
|
233 |
request.args.get("id") or "0000000000000000000",
|
234 |
request.args.get("content") or "Make it a Quote",
|
235 |
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
|
|
240 |
def reverse():
|
241 |
res = reverseMake(
|
242 |
request.args.get("name") or "SAMPLE",
|
|
|
243 |
request.args.get("id") or "0000000000000000000",
|
244 |
request.args.get("content") or "Make it a Quote",
|
245 |
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
|
|
250 |
def white():
|
251 |
res = whiteMake(
|
252 |
request.args.get("name") or "SAMPLE",
|
|
|
253 |
request.args.get("id") or "0000000000000000000",
|
254 |
request.args.get("content") or "Make it a Quote",
|
255 |
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
|
|
260 |
def reverseWhite():
|
261 |
res = reverseWhiteMake(
|
262 |
request.args.get("name") or "SAMPLE",
|
|
|
263 |
request.args.get("id") or "0000000000000000000",
|
264 |
request.args.get("content") or "Make it a Quote",
|
265 |
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|