sticker-convert 2.3.0__py3-none-any.whl → 2.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sticker_convert/__init__.py +1 -1
- sticker_convert/cli.py +15 -7
- sticker_convert/converter.py +180 -118
- sticker_convert/downloaders/download_line.py +7 -3
- sticker_convert/gui.py +15 -5
- sticker_convert/gui_components/frames/comp_frame.py +5 -0
- sticker_convert/gui_components/windows/advanced_compression_window.py +55 -15
- sticker_convert/job.py +20 -0
- sticker_convert/job_option.py +13 -4
- sticker_convert/resources/compression.json +92 -42
- sticker_convert/resources/help.json +5 -0
- sticker_convert/uploaders/compress_wastickers.py +2 -1
- sticker_convert/uploaders/xcode_imessage.py +2 -1
- sticker_convert/utils/files/sanitize_filename.py +51 -0
- sticker_convert/utils/media/codec_info.py +185 -119
- sticker_convert/utils/media/format_verify.py +80 -79
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.4.0.dist-info}/METADATA +25 -8
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.4.0.dist-info}/RECORD +22 -21
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.4.0.dist-info}/LICENSE +0 -0
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.4.0.dist-info}/WHEEL +0 -0
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.4.0.dist-info}/entry_points.txt +0 -0
- {sticker_convert-2.3.0.dist-info → sticker_convert-2.4.0.dist-info}/top_level.txt +0 -0
@@ -108,6 +108,24 @@ class AdvancedCompressionWindow(BaseWindow):
|
|
108
108
|
self.vid_format_entry = Entry(self.frame_advcomp, textvariable=self.gui.vid_format_var, width=8)
|
109
109
|
self.vid_format_entry.bind('<Button-3><ButtonRelease-3>', RightClicker)
|
110
110
|
|
111
|
+
self.power_help_btn1 = Button(self.frame_advcomp, text='?', width=1, command=lambda: cb_msg_block_adv_comp_win(self.gui.help['comp']['fps_power']), bootstyle='secondary')
|
112
|
+
self.power_lbl1 = Label(self.frame_advcomp, text='Power (Importance)')
|
113
|
+
self.fps_power_lbl = Label(self.frame_advcomp, text='FPS:')
|
114
|
+
self.fps_power_entry = Entry(self.frame_advcomp, textvariable=self.gui.fps_power_var, width=8)
|
115
|
+
self.fps_power_entry.bind('<Button-3><ButtonRelease-3>', RightClicker)
|
116
|
+
self.res_power_lbl = Label(self.frame_advcomp, text='Res:')
|
117
|
+
self.res_power_entry = Entry(self.frame_advcomp, textvariable=self.gui.res_power_var, width=8)
|
118
|
+
self.res_power_entry.bind('<Button-3><ButtonRelease-3>', RightClicker)
|
119
|
+
|
120
|
+
self.power_help_btn2 = Button(self.frame_advcomp, text='?', width=1, command=lambda: cb_msg_block_adv_comp_win(self.gui.help['comp']['fps_power']), bootstyle='secondary')
|
121
|
+
self.power_lbl2 = Label(self.frame_advcomp, text='Power (Importance)')
|
122
|
+
self.quality_power_lbl = Label(self.frame_advcomp, text='Quality:')
|
123
|
+
self.quality_power_entry = Entry(self.frame_advcomp, textvariable=self.gui.quality_power_var, width=8)
|
124
|
+
self.quality_power_entry.bind('<Button-3><ButtonRelease-3>', RightClicker)
|
125
|
+
self.color_power_lbl = Label(self.frame_advcomp, text='Color:')
|
126
|
+
self.color_power_entry = Entry(self.frame_advcomp, textvariable=self.gui.color_power_var, width=8)
|
127
|
+
self.color_power_entry.bind('<Button-3><ButtonRelease-3>', RightClicker)
|
128
|
+
|
111
129
|
self.fake_vid_help_btn = Button(self.frame_advcomp, text='?', width=1, command=lambda: cb_msg_block_adv_comp_win(self.gui.help['comp']['fake_vid']), bootstyle='secondary')
|
112
130
|
self.fake_vid_lbl = Label(self.frame_advcomp, text='Convert (faking) image to video')
|
113
131
|
self.fake_vid_cbox = Checkbutton(self.frame_advcomp, variable=self.gui.fake_vid_var, onvalue=True, offvalue=False, bootstyle='success-round-toggle')
|
@@ -116,6 +134,10 @@ class AdvancedCompressionWindow(BaseWindow):
|
|
116
134
|
self.scale_filter_lbl = Label(self.frame_advcomp, text='Scale filter')
|
117
135
|
self.scale_filter_opt = OptionMenu(self.frame_advcomp, self.gui.scale_filter_var, self.gui.scale_filter_var.get(), 'nearest', 'bilinear', 'bicubic', 'lanczos', bootstyle='secondary')
|
118
136
|
|
137
|
+
self.quantize_method_help_btn = Button(self.frame_advcomp, text='?', width=1, command=lambda: cb_msg_block_adv_comp_win(self.gui.help['comp']['quantize_method']), bootstyle='secondary')
|
138
|
+
self.quantize_method_lbl = Label(self.frame_advcomp, text='Quantize method')
|
139
|
+
self.quantize_method_opt = OptionMenu(self.frame_advcomp, self.gui.quantize_method_var, self.gui.quantize_method_var.get(), 'imagequant', 'fastoctree', 'none', bootstyle='secondary')
|
140
|
+
|
119
141
|
self.cache_dir_help_btn = Button(self.frame_advcomp, text='?', width=1, command=lambda: cb_msg_block_adv_comp_win(self.gui.help['comp']['cache_dir']), bootstyle='secondary')
|
120
142
|
self.cache_dir_lbl = Label(self.frame_advcomp, text='Custom cache directory')
|
121
143
|
self.cache_dir_entry = Entry(self.frame_advcomp, textvariable=self.gui.cache_dir_var, width=30)
|
@@ -190,21 +212,39 @@ class AdvancedCompressionWindow(BaseWindow):
|
|
190
212
|
self.vid_format_lbl.grid(column=4, row=9, sticky='w', padx=3, pady=3)
|
191
213
|
self.vid_format_entry.grid(column=5, row=9, sticky='nes', padx=3, pady=3)
|
192
214
|
|
193
|
-
self.
|
194
|
-
self.
|
195
|
-
self.
|
196
|
-
|
197
|
-
self.
|
198
|
-
self.
|
199
|
-
|
200
|
-
|
201
|
-
self.
|
202
|
-
self.
|
203
|
-
self.
|
204
|
-
|
205
|
-
self.
|
206
|
-
|
207
|
-
self.
|
215
|
+
self.power_help_btn1.grid(column=0, row=10, sticky='w', padx=3, pady=3)
|
216
|
+
self.power_lbl1.grid(column=1, row=10, sticky='w', padx=3, pady=3)
|
217
|
+
self.fps_power_lbl.grid(column=2, row=10, sticky='w', padx=3, pady=3)
|
218
|
+
self.fps_power_entry.grid(column=3, row=10, sticky='w', padx=3, pady=3)
|
219
|
+
self.res_power_lbl.grid(column=4, row=10, sticky='w', padx=3, pady=3)
|
220
|
+
self.res_power_entry.grid(column=5, row=10, sticky='w', padx=3, pady=3)
|
221
|
+
|
222
|
+
self.power_help_btn2.grid(column=0, row=11, sticky='w', padx=3, pady=3)
|
223
|
+
self.power_lbl2.grid(column=1, row=11, sticky='w', padx=3, pady=3)
|
224
|
+
self.quality_power_lbl.grid(column=2, row=11, sticky='w', padx=3, pady=3)
|
225
|
+
self.quality_power_entry.grid(column=3, row=11, sticky='w', padx=3, pady=3)
|
226
|
+
self.color_power_lbl.grid(column=4, row=11, sticky='w', padx=3, pady=3)
|
227
|
+
self.color_power_entry.grid(column=5, row=11, sticky='w', padx=3, pady=3)
|
228
|
+
|
229
|
+
self.fake_vid_help_btn.grid(column=0, row=12, sticky='w', padx=3, pady=3)
|
230
|
+
self.fake_vid_lbl.grid(column=1, row=12, sticky='w', padx=3, pady=3)
|
231
|
+
self.fake_vid_cbox.grid(column=6, row=12, sticky='nes', padx=3, pady=3)
|
232
|
+
|
233
|
+
self.scale_filter_help_btn.grid(column=0, row=13, sticky='w', padx=3, pady=3)
|
234
|
+
self.scale_filter_lbl.grid(column=1, row=13, sticky='w', padx=3, pady=3)
|
235
|
+
self.scale_filter_opt.grid(column=2, row=13, columnspan=4, sticky='nes', padx=3, pady=3)
|
236
|
+
|
237
|
+
self.quantize_method_help_btn.grid(column=0, row=14, sticky='w', padx=3, pady=3)
|
238
|
+
self.quantize_method_lbl.grid(column=1, row=14, sticky='w', padx=3, pady=3)
|
239
|
+
self.quantize_method_opt.grid(column=2, row=14, columnspan=4, sticky='nes', padx=3, pady=3)
|
240
|
+
|
241
|
+
self.cache_dir_help_btn.grid(column=0, row=15, sticky='w', padx=3, pady=3)
|
242
|
+
self.cache_dir_lbl.grid(column=1, row=15, sticky='w', padx=3, pady=3)
|
243
|
+
self.cache_dir_entry.grid(column=2, row=15, columnspan=4, sticky='nes', padx=3, pady=3)
|
244
|
+
|
245
|
+
self.default_emoji_help_btn.grid(column=0, row=16, sticky='w', padx=3, pady=3)
|
246
|
+
self.default_emoji_lbl.grid(column=1, row=16, sticky='w', padx=3, pady=3)
|
247
|
+
self.default_emoji_dsp.grid(column=6, row=16, sticky='nes', padx=3, pady=3)
|
208
248
|
|
209
249
|
# https://stackoverflow.com/questions/43731784/tkinter-canvas-scrollbar-with-grid
|
210
250
|
# Create a frame for the canvas with non-zero row&column weights
|
sticker_convert/job.py
CHANGED
@@ -177,6 +177,26 @@ class Job:
|
|
177
177
|
if response == False:
|
178
178
|
return False
|
179
179
|
|
180
|
+
for param, value in (
|
181
|
+
('fps_power', self.opt_comp.fps_power),
|
182
|
+
('res_power', self.opt_comp.res_power),
|
183
|
+
('quality_power', self.opt_comp.quality_power),
|
184
|
+
('color_power', self.opt_comp.color_power)
|
185
|
+
):
|
186
|
+
if value < -1:
|
187
|
+
error_msg += '\n'
|
188
|
+
error_msg += f'[X] {param} should be between -1 and positive infinity. {value} was given.'
|
189
|
+
|
190
|
+
if self.opt_comp.scale_filter not in ('nearest', 'bilinear', 'bicubic', 'lanczos'):
|
191
|
+
error_msg += '\n'
|
192
|
+
error_msg += f'[X] scale_filter {self.opt_comp.scale_filter} is not valid option'
|
193
|
+
error_msg += ' Valid options: nearest, bilinear, bicubic, lanczos'
|
194
|
+
|
195
|
+
if self.opt_comp.quantize_method not in ('imagequant', 'fastoctree', 'none'):
|
196
|
+
error_msg += '\n'
|
197
|
+
error_msg += f'[X] quantize_method {self.opt_comp.quantize_method} is not valid option'
|
198
|
+
error_msg += ' Valid options: imagequant, fastoctree, none'
|
199
|
+
|
180
200
|
# Warn about unable to download animated Kakao stickers with such link
|
181
201
|
if (self.opt_output.option == 'kakao' and
|
182
202
|
urlparse(self.opt_input.url).netloc == 'e.kakao.com' and
|
sticker_convert/job_option.py
CHANGED
@@ -52,6 +52,7 @@ class CompOption(BaseOption):
|
|
52
52
|
else:
|
53
53
|
self.fps_min = to_int(fps)
|
54
54
|
self.fps_max = to_int(fps)
|
55
|
+
self.fps_power = fps.get('power') if fps.get('power') else 1.0
|
55
56
|
|
56
57
|
self.res_w_min = None
|
57
58
|
self.res_w_max = None
|
@@ -91,6 +92,7 @@ class CompOption(BaseOption):
|
|
91
92
|
self.res_w_max = to_int(res)
|
92
93
|
self.res_h_min = to_int(res)
|
93
94
|
self.res_h_max = to_int(res)
|
95
|
+
self.res_power = res.get('power') if res.get('power') else 1.0
|
94
96
|
|
95
97
|
quality = comp_config_dict.get('quality')
|
96
98
|
if isinstance(quality, dict):
|
@@ -99,6 +101,7 @@ class CompOption(BaseOption):
|
|
99
101
|
else:
|
100
102
|
self.quality_min = to_int(quality)
|
101
103
|
self.quality_max = to_int(quality)
|
104
|
+
self.quality_power = quality.get('power') if quality.get('power') else 1.0
|
102
105
|
|
103
106
|
color = comp_config_dict.get('color')
|
104
107
|
if isinstance(color, dict):
|
@@ -107,6 +110,7 @@ class CompOption(BaseOption):
|
|
107
110
|
else:
|
108
111
|
self.color_min = to_int(color)
|
109
112
|
self.color_max = to_int(color)
|
113
|
+
self.color_power = color.get('power') if color.get('power') else 1.0
|
110
114
|
|
111
115
|
duration = comp_config_dict.get('duration')
|
112
116
|
if isinstance(duration, dict):
|
@@ -118,6 +122,7 @@ class CompOption(BaseOption):
|
|
118
122
|
|
119
123
|
self.steps = to_int(comp_config_dict.get('steps'))
|
120
124
|
self.fake_vid = comp_config_dict.get('fake_vid')
|
125
|
+
self.quantize_method = comp_config_dict.get('quantize_method', 'imagequant')
|
121
126
|
self.scale_filter = comp_config_dict.get('scale_filter', 'lanczos')
|
122
127
|
self.cache_dir = comp_config_dict.get('cache_dir')
|
123
128
|
self.default_emoji = comp_config_dict.get('default_emoji')
|
@@ -141,7 +146,8 @@ class CompOption(BaseOption):
|
|
141
146
|
},
|
142
147
|
'fps': {
|
143
148
|
'min': self.fps_min,
|
144
|
-
'max': self.fps_max
|
149
|
+
'max': self.fps_max,
|
150
|
+
'power': self.fps_power
|
145
151
|
},
|
146
152
|
'res': {
|
147
153
|
'w': {
|
@@ -151,15 +157,18 @@ class CompOption(BaseOption):
|
|
151
157
|
'h': {
|
152
158
|
'min': self.res_h_min,
|
153
159
|
'max': self.res_h_max
|
154
|
-
}
|
160
|
+
},
|
161
|
+
'power': self.res_power
|
155
162
|
},
|
156
163
|
'quality': {
|
157
164
|
'min': self.quality_min,
|
158
|
-
'max': self.quality_max
|
165
|
+
'max': self.quality_max,
|
166
|
+
'power': self.quality_power
|
159
167
|
},
|
160
168
|
'color': {
|
161
169
|
'min': self.color_min,
|
162
|
-
'max': self.color_max
|
170
|
+
'max': self.color_max,
|
171
|
+
'power': self.color_power
|
163
172
|
},
|
164
173
|
'duration': {
|
165
174
|
'min': self.duration_min,
|
@@ -10,7 +10,8 @@
|
|
10
10
|
},
|
11
11
|
"fps": {
|
12
12
|
"min": 1,
|
13
|
-
"max": 30
|
13
|
+
"max": 30,
|
14
|
+
"power": -0.5
|
14
15
|
},
|
15
16
|
"res": {
|
16
17
|
"w": {
|
@@ -20,15 +21,18 @@
|
|
20
21
|
"h": {
|
21
22
|
"min": 512,
|
22
23
|
"max": 512
|
23
|
-
}
|
24
|
+
},
|
25
|
+
"power": 3
|
24
26
|
},
|
25
27
|
"quality": {
|
26
28
|
"min": 50,
|
27
|
-
"max": 95
|
29
|
+
"max": 95,
|
30
|
+
"power": 5
|
28
31
|
},
|
29
32
|
"color": {
|
30
33
|
"min": 50,
|
31
|
-
"max": 257
|
34
|
+
"max": 257,
|
35
|
+
"power": 2
|
32
36
|
},
|
33
37
|
"duration": {
|
34
38
|
"min": 0,
|
@@ -37,6 +41,7 @@
|
|
37
41
|
"steps": 16,
|
38
42
|
"fake_vid": false,
|
39
43
|
"scale_filter": "lanczos",
|
44
|
+
"quantize_method": "imagequant",
|
40
45
|
"default_emoji": "😀"
|
41
46
|
},
|
42
47
|
"signal": {
|
@@ -50,25 +55,29 @@
|
|
50
55
|
},
|
51
56
|
"fps": {
|
52
57
|
"min": 1,
|
53
|
-
"max": 30
|
58
|
+
"max": 30,
|
59
|
+
"power": -0.5
|
54
60
|
},
|
55
61
|
"res": {
|
56
62
|
"w": {
|
57
|
-
"min":
|
63
|
+
"min": 128,
|
58
64
|
"max": 512
|
59
65
|
},
|
60
66
|
"h": {
|
61
|
-
"min":
|
67
|
+
"min": 128,
|
62
68
|
"max": 512
|
63
|
-
}
|
69
|
+
},
|
70
|
+
"power": 3
|
64
71
|
},
|
65
72
|
"quality": {
|
66
73
|
"min": 50,
|
67
|
-
"max": 95
|
74
|
+
"max": 95,
|
75
|
+
"power": 5
|
68
76
|
},
|
69
77
|
"color": {
|
70
78
|
"min": 50,
|
71
|
-
"max": 257
|
79
|
+
"max": 257,
|
80
|
+
"power": 2
|
72
81
|
},
|
73
82
|
"duration": {
|
74
83
|
"min": 0,
|
@@ -77,6 +86,7 @@
|
|
77
86
|
"steps": 16,
|
78
87
|
"fake_vid": false,
|
79
88
|
"scale_filter": "lanczos",
|
89
|
+
"quantize_method": "imagequant",
|
80
90
|
"default_emoji": "😀"
|
81
91
|
},
|
82
92
|
"telegram": {
|
@@ -90,7 +100,8 @@
|
|
90
100
|
},
|
91
101
|
"fps": {
|
92
102
|
"min": 1,
|
93
|
-
"max": 30
|
103
|
+
"max": 30,
|
104
|
+
"power": -0.5
|
94
105
|
},
|
95
106
|
"res": {
|
96
107
|
"w": {
|
@@ -100,15 +111,18 @@
|
|
100
111
|
"h": {
|
101
112
|
"min": 512,
|
102
113
|
"max": 512
|
103
|
-
}
|
114
|
+
},
|
115
|
+
"power": 3
|
104
116
|
},
|
105
117
|
"quality": {
|
106
118
|
"min": 50,
|
107
|
-
"max": 95
|
119
|
+
"max": 95,
|
120
|
+
"power": 5
|
108
121
|
},
|
109
122
|
"color": {
|
110
123
|
"min": 50,
|
111
|
-
"max": 257
|
124
|
+
"max": 257,
|
125
|
+
"power": 2
|
112
126
|
},
|
113
127
|
"duration": {
|
114
128
|
"min": 0,
|
@@ -117,6 +131,7 @@
|
|
117
131
|
"steps": 16,
|
118
132
|
"fake_vid": false,
|
119
133
|
"scale_filter": "lanczos",
|
134
|
+
"quantize_method": "imagequant",
|
120
135
|
"default_emoji": "😀"
|
121
136
|
},
|
122
137
|
"whatsapp": {
|
@@ -130,7 +145,8 @@
|
|
130
145
|
},
|
131
146
|
"fps": {
|
132
147
|
"min": 1,
|
133
|
-
"max": 30
|
148
|
+
"max": 30,
|
149
|
+
"power": -0.5
|
134
150
|
},
|
135
151
|
"res": {
|
136
152
|
"w": {
|
@@ -140,15 +156,18 @@
|
|
140
156
|
"h": {
|
141
157
|
"min": 512,
|
142
158
|
"max": 512
|
143
|
-
}
|
159
|
+
},
|
160
|
+
"power": 3
|
144
161
|
},
|
145
162
|
"quality": {
|
146
163
|
"min": 50,
|
147
|
-
"max": 95
|
164
|
+
"max": 95,
|
165
|
+
"power": 5
|
148
166
|
},
|
149
167
|
"color": {
|
150
168
|
"min": 50,
|
151
|
-
"max": 257
|
169
|
+
"max": 257,
|
170
|
+
"power": 2
|
152
171
|
},
|
153
172
|
"duration": {
|
154
173
|
"min": 8,
|
@@ -157,6 +176,7 @@
|
|
157
176
|
"steps": 16,
|
158
177
|
"fake_vid": true,
|
159
178
|
"scale_filter": "lanczos",
|
179
|
+
"quantize_method": "imagequant",
|
160
180
|
"default_emoji": "😀"
|
161
181
|
},
|
162
182
|
"line": {
|
@@ -170,7 +190,8 @@
|
|
170
190
|
},
|
171
191
|
"fps": {
|
172
192
|
"min": 1,
|
173
|
-
"max": 60
|
193
|
+
"max": 60,
|
194
|
+
"power": -0.5
|
174
195
|
},
|
175
196
|
"res": {
|
176
197
|
"w": {
|
@@ -180,15 +201,18 @@
|
|
180
201
|
"h": {
|
181
202
|
"min": 100,
|
182
203
|
"max": 320
|
183
|
-
}
|
204
|
+
},
|
205
|
+
"power": 3
|
184
206
|
},
|
185
207
|
"quality": {
|
186
208
|
"min": 50,
|
187
|
-
"max": 95
|
209
|
+
"max": 95,
|
210
|
+
"power": 5
|
188
211
|
},
|
189
212
|
"color": {
|
190
213
|
"min": 50,
|
191
|
-
"max": 257
|
214
|
+
"max": 257,
|
215
|
+
"power": 2
|
192
216
|
},
|
193
217
|
"duration": {
|
194
218
|
"min": 83,
|
@@ -197,6 +221,7 @@
|
|
197
221
|
"steps": 16,
|
198
222
|
"fake_vid": false,
|
199
223
|
"scale_filter": "lanczos",
|
224
|
+
"quantize_method": "imagequant",
|
200
225
|
"default_emoji": "😀"
|
201
226
|
},
|
202
227
|
"kakao": {
|
@@ -210,7 +235,8 @@
|
|
210
235
|
},
|
211
236
|
"fps": {
|
212
237
|
"min": 1,
|
213
|
-
"max": 60
|
238
|
+
"max": 60,
|
239
|
+
"power": -0.5
|
214
240
|
},
|
215
241
|
"res": {
|
216
242
|
"w": {
|
@@ -220,15 +246,18 @@
|
|
220
246
|
"h": {
|
221
247
|
"min": 360,
|
222
248
|
"max": 360
|
223
|
-
}
|
249
|
+
},
|
250
|
+
"power": 3
|
224
251
|
},
|
225
252
|
"quality": {
|
226
253
|
"min": 50,
|
227
|
-
"max": 95
|
254
|
+
"max": 95,
|
255
|
+
"power": 5
|
228
256
|
},
|
229
257
|
"color": {
|
230
258
|
"min": 50,
|
231
|
-
"max": 257
|
259
|
+
"max": 257,
|
260
|
+
"power": 2
|
232
261
|
},
|
233
262
|
"duration": {
|
234
263
|
"min": 0,
|
@@ -237,6 +266,7 @@
|
|
237
266
|
"steps": 16,
|
238
267
|
"fake_vid": false,
|
239
268
|
"scale_filter": "lanczos",
|
269
|
+
"quantize_method": "imagequant",
|
240
270
|
"default_emoji": "😀"
|
241
271
|
},
|
242
272
|
"imessage_small": {
|
@@ -250,7 +280,8 @@
|
|
250
280
|
},
|
251
281
|
"fps": {
|
252
282
|
"min": 1,
|
253
|
-
"max": 60
|
283
|
+
"max": 60,
|
284
|
+
"power": -0.5
|
254
285
|
},
|
255
286
|
"res": {
|
256
287
|
"w": {
|
@@ -260,15 +291,18 @@
|
|
260
291
|
"h": {
|
261
292
|
"min": 300,
|
262
293
|
"max": 300
|
263
|
-
}
|
294
|
+
},
|
295
|
+
"power": 3
|
264
296
|
},
|
265
297
|
"quality": {
|
266
298
|
"min": 50,
|
267
|
-
"max": 95
|
299
|
+
"max": 95,
|
300
|
+
"power": 5
|
268
301
|
},
|
269
302
|
"color": {
|
270
303
|
"min": 50,
|
271
|
-
"max": 257
|
304
|
+
"max": 257,
|
305
|
+
"power": 2
|
272
306
|
},
|
273
307
|
"duration": {
|
274
308
|
"min": 0,
|
@@ -277,6 +311,7 @@
|
|
277
311
|
"steps": 8,
|
278
312
|
"fake_vid": false,
|
279
313
|
"scale_filter": "lanczos",
|
314
|
+
"quantize_method": "imagequant",
|
280
315
|
"default_emoji": "😀"
|
281
316
|
},
|
282
317
|
"imessage_medium": {
|
@@ -290,7 +325,8 @@
|
|
290
325
|
},
|
291
326
|
"fps": {
|
292
327
|
"min": 1,
|
293
|
-
"max": 60
|
328
|
+
"max": 60,
|
329
|
+
"power": -0.5
|
294
330
|
},
|
295
331
|
"res": {
|
296
332
|
"w": {
|
@@ -300,15 +336,18 @@
|
|
300
336
|
"h": {
|
301
337
|
"min": 408,
|
302
338
|
"max": 408
|
303
|
-
}
|
339
|
+
},
|
340
|
+
"power": 3
|
304
341
|
},
|
305
342
|
"quality": {
|
306
343
|
"min": 50,
|
307
|
-
"max": 95
|
344
|
+
"max": 95,
|
345
|
+
"power": 5
|
308
346
|
},
|
309
347
|
"color": {
|
310
348
|
"min": 50,
|
311
|
-
"max": 257
|
349
|
+
"max": 257,
|
350
|
+
"power": 2
|
312
351
|
},
|
313
352
|
"duration": {
|
314
353
|
"min": 0,
|
@@ -317,6 +356,7 @@
|
|
317
356
|
"steps": 8,
|
318
357
|
"fake_vid": false,
|
319
358
|
"scale_filter": "lanczos",
|
359
|
+
"quantize_method": "imagequant",
|
320
360
|
"default_emoji": "😀"
|
321
361
|
},
|
322
362
|
"imessage_large": {
|
@@ -330,7 +370,8 @@
|
|
330
370
|
},
|
331
371
|
"fps": {
|
332
372
|
"min": 1,
|
333
|
-
"max": 60
|
373
|
+
"max": 60,
|
374
|
+
"power": -0.5
|
334
375
|
},
|
335
376
|
"res": {
|
336
377
|
"w": {
|
@@ -340,15 +381,18 @@
|
|
340
381
|
"h": {
|
341
382
|
"min": 618,
|
342
383
|
"max": 618
|
343
|
-
}
|
384
|
+
},
|
385
|
+
"power": 3
|
344
386
|
},
|
345
387
|
"quality": {
|
346
388
|
"min": 50,
|
347
|
-
"max": 95
|
389
|
+
"max": 95,
|
390
|
+
"power": 5
|
348
391
|
},
|
349
392
|
"color": {
|
350
393
|
"min": 50,
|
351
|
-
"max": 257
|
394
|
+
"max": 257,
|
395
|
+
"power": 2
|
352
396
|
},
|
353
397
|
"duration": {
|
354
398
|
"min": 0,
|
@@ -357,6 +401,7 @@
|
|
357
401
|
"steps": 8,
|
358
402
|
"fake_vid": false,
|
359
403
|
"scale_filter": "lanczos",
|
404
|
+
"quantize_method": "imagequant",
|
360
405
|
"default_emoji": "😀"
|
361
406
|
},
|
362
407
|
"custom": {
|
@@ -370,7 +415,8 @@
|
|
370
415
|
},
|
371
416
|
"fps": {
|
372
417
|
"min": 1,
|
373
|
-
"max": 30
|
418
|
+
"max": 30,
|
419
|
+
"power": -0.5
|
374
420
|
},
|
375
421
|
"res": {
|
376
422
|
"w": {
|
@@ -380,15 +426,18 @@
|
|
380
426
|
"h": {
|
381
427
|
"min": 512,
|
382
428
|
"max": 512
|
383
|
-
}
|
429
|
+
},
|
430
|
+
"power": 3
|
384
431
|
},
|
385
432
|
"quality": {
|
386
433
|
"min": 50,
|
387
|
-
"max": 95
|
434
|
+
"max": 95,
|
435
|
+
"power": 5
|
388
436
|
},
|
389
437
|
"color": {
|
390
438
|
"min": 50,
|
391
|
-
"max": 257
|
439
|
+
"max": 257,
|
440
|
+
"power": 2
|
392
441
|
},
|
393
442
|
"duration": {
|
394
443
|
"min": 0,
|
@@ -397,6 +446,7 @@
|
|
397
446
|
"steps": 16,
|
398
447
|
"fake_vid": false,
|
399
448
|
"scale_filter": "lanczos",
|
449
|
+
"quantize_method": "imagequant",
|
400
450
|
"default_emoji": "😀"
|
401
451
|
}
|
402
452
|
}
|
@@ -18,6 +18,7 @@
|
|
18
18
|
"fps": "FPS Higher = Smoother but larger size.",
|
19
19
|
"fps_min": "Set minimum output fps.",
|
20
20
|
"fps_max": "Set maximum output fps.",
|
21
|
+
"fps_power": "Between -1 and positive infinity. Power lower = More importance of the parameter, try harder to keep higher and not sacrifice.",
|
21
22
|
"res": "Resolution higher = Clearer but larger size.",
|
22
23
|
"res_min": "Set minimum width and height",
|
23
24
|
"res_max": "Set maximum width and height",
|
@@ -25,12 +26,15 @@
|
|
25
26
|
"res_w_max": "Set maximum width.",
|
26
27
|
"res_h_min": "Set minimum height.",
|
27
28
|
"res_h_max": "Set maximum height.",
|
29
|
+
"res_power": "Between -1 and positive infinity.\nPower lower = More importance of the parameter,\ntry harder to keep higher and not sacrifice.",
|
28
30
|
"quality": "Quality higher = Clearer but larger size.",
|
29
31
|
"quality_min": "Set minimum quality.",
|
30
32
|
"quality_max": "Set maximum quality.",
|
33
|
+
"quality_power": "Between -1 and positive infinity. Power lower = More importance of the parameter, try harder to keep higher and not sacrifice.",
|
31
34
|
"color": "Reduce size by limiting number of colors.\nMakes image 'blocky'. >256 will disable this.\nApplies to png and apng only.\nColor higher = More colors but larger size.",
|
32
35
|
"color_min": "Set minimum number of colors (For converting to apng and apng only).",
|
33
36
|
"color_max": "Set maximum number of colors (For converting to apng and apng only).",
|
37
|
+
"color_power": "Between -1 and positive infinity. Power lower = More importance of the parameter, try harder to keep higher and not sacrifice.",
|
34
38
|
"duration": "Change playback speed if outside of duration limit.\nDuration set in miliseconds.\n0 will disable limit.",
|
35
39
|
"duration_min": "Set minimum output duration in miliseconds.",
|
36
40
|
"duration_max": "Set maximum output duration in miliseconds.",
|
@@ -42,6 +46,7 @@
|
|
42
46
|
"img_format": "Set file format if input is static.",
|
43
47
|
"fake_vid": "Convert (faking) image to video.\nUseful if:\n(1) Size limit for video is larger than image;\n(2) Mix image and video into same pack.",
|
44
48
|
"scale_filter": "Set scale filter. Default as lanczos. Valid options are:\n- nearest = Use nearest neighbour (Suitable for pixel art)\n- bilinear = linear interpolation\n- bicubic = Cubic spline interpolation\n- lanczos = A high-quality downsampling filter",
|
49
|
+
"quantize_method": "Set method for quantizing image. Default as imagequant. Valid options are:\n- imagequant = Best quality but slow\n- fastoctree = Fast but image looks chunky\n- none = No image quantizing, large image size as result",
|
45
50
|
"cache_dir": "Set custom cache directory.\nUseful for debugging, or speed up conversion if cache_dir is on RAM disk.",
|
46
51
|
"default_emoji": "Set the default emoji for uploading Signal and Telegram sticker packs."
|
47
52
|
},
|
@@ -9,6 +9,7 @@ from .upload_base import UploadBase # type: ignore
|
|
9
9
|
from ..converter import StickerConvert # type: ignore
|
10
10
|
from ..utils.media.format_verify import FormatVerify # type: ignore
|
11
11
|
from ..utils.files.metadata_handler import MetadataHandler # type: ignore
|
12
|
+
from ..utils.files.sanitize_filename import sanitize_filename # type: ignore
|
12
13
|
from ..utils.media.codec_info import CodecInfo # type: ignore
|
13
14
|
from ..utils.files.cache_store import CacheStore # type: ignore
|
14
15
|
from ..job_option import CompOption, OutputOption, CredOption # type: ignore
|
@@ -80,7 +81,7 @@ class CompressWastickers(UploadBase):
|
|
80
81
|
|
81
82
|
out_f = os.path.join(
|
82
83
|
self.out_dir,
|
83
|
-
|
84
|
+
sanitize_filename(pack_title + ".wastickers"),
|
84
85
|
)
|
85
86
|
|
86
87
|
self.add_metadata(tempdir, pack_title, author)
|
@@ -12,6 +12,7 @@ from ..converter import StickerConvert # type: ignore
|
|
12
12
|
from ..utils.media.format_verify import FormatVerify # type: ignore
|
13
13
|
from ..utils.media.codec_info import CodecInfo # type: ignore
|
14
14
|
from ..utils.files.metadata_handler import MetadataHandler # type: ignore
|
15
|
+
from ..utils.files.sanitize_filename import sanitize_filename # type: ignore
|
15
16
|
from ..job_option import CompOption, OutputOption, CredOption # type: ignore
|
16
17
|
|
17
18
|
|
@@ -101,7 +102,7 @@ class XcodeImessage(UploadBase):
|
|
101
102
|
res_choice = None
|
102
103
|
|
103
104
|
for pack_title, stickers in packs.items():
|
104
|
-
pack_title =
|
105
|
+
pack_title = sanitize_filename(pack_title)
|
105
106
|
|
106
107
|
for src in stickers:
|
107
108
|
self.cb_msg(f"Verifying {src} for creating Xcode iMessage sticker pack")
|