|
1 | 1 | import tempfile
|
2 |
| -from urllib.parse import urlparse |
3 | 2 | from pathlib import Path
|
4 | 3 | from typing import List
|
| 4 | +from urllib.parse import urlparse |
5 | 5 |
|
6 | 6 | from .types import StoryBuild, StoryMention, StorySticker
|
7 | 7 |
|
@@ -137,17 +137,17 @@ def build_main(self, clip, max_duration: int = 0, font: str = 'Arial', fontsize:
|
137 | 137 | )
|
138 | 138 | link_sticker = StorySticker(
|
139 | 139 | # x=160.0, y=641.0, z=0, width=400.0, height=88.0,
|
140 |
| - x=link_clip_left / self.width, # e.g. 0.49953705 |
141 |
| - y=link_clip_top / self.height, # e.g. 0.5 |
| 140 | + x=round(link_clip_left / self.width, 7), # e.g. 0.49953705 |
| 141 | + y=round(link_clip_top / self.height, 7), # e.g. 0.5 |
142 | 142 | z=0,
|
143 |
| - width=link_clip.size[0] / self.width, # e.g. 0.50912 |
144 |
| - height=link_clip.size[1] / self.height, # e.g. 0.06875 |
| 143 | + width=round(link_clip.size[0] / self.width, 7), # e.g. 0.50912 |
| 144 | + height=round(link_clip.size[1] / self.height, 7), # e.g. 0.06875 |
145 | 145 | rotation=0.0,
|
146 | 146 | # id="link_sticker_default",
|
147 | 147 | type="story_link",
|
148 | 148 | extra=dict(
|
149 | 149 | link_type="web",
|
150 |
| - url=link, # e.g. "https//github.com/" |
| 150 | + url=str(link), # e.g. "https//github.com/" |
151 | 151 | tap_state_str_id="link_sticker_default",
|
152 | 152 | )
|
153 | 153 | )
|
|
0 commit comments