Skip to content

Commit

Permalink
Revert "Update export_result.py"
Browse files Browse the repository at this point in the history
  • Loading branch information
PauperZ authored Sep 7, 2024
1 parent cc08443 commit 30fb486
Show file tree
Hide file tree
Showing 3 changed files with 260 additions and 240 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
<h1 align="center">
<img src="https://i.jpg.dog/file/jpg-dog/9160396e547d9abde7ec3199c571aa47.png" alt="SSRSpeedN" width="240">
</h1>
<p align="center">
Batch speed measuring tool based on Shadowsocks(R) and V2Ray
</p>
<p align="center">
<a href="https://github.com/PauperZ/SSRSpeedN/tags"><img src="https://img.shields.io/github/tag/PauperZ/SSRSpeedN.svg"></a>
<a href="https://github.com/PauperZ/SSRSpeedN/releases"><img src="https://img.shields.io/github/release/PauperZ/SSRSpeedN.svg"></a>
<a href="https://github.com/PauperZ/SSRSpeedN/blob/master/LICENSE"><img src="https://img.shields.io/github/license/PauperZ/SSRSpeedN.svg"></a>
</p>

## 赞赏码
<h1 align="center">
<img src="https://i.jpg.dog/file/jpg-dog/c1fd65efd85f41686d0d67fe4d09d21f.jpg" alt="SSRSpeedN" width="512">
</h1>
<p align="center">
要饭人士跪求各位大佬雪中送炭
</p>

## 注意事项

##
- 测速及解锁测试仅供参考,不代表实际使用情况,由于网络情况变化、Netflix封锁及ip更换,测速具有时效性

- 本项目使用 [Python](https://www.python.org/) 编写,使用前请完成环境安装
Expand Down
12 changes: 6 additions & 6 deletions ssrspeed/result/export_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ def __getMaxWidth(self,result):
remark = item["remarks"]
inres = item["InRes"]
outres = item["OutRes"]
maxGroupWidth = max(maxGroupWidth, draw.textbbox((0, 0), group, font=font)[2])
maxRemarkWidth = max(maxRemarkWidth, draw.textbbox((0, 0), remark, font=font)[2])
lenIn = max(lenIn, draw.textbbox((0, 0), inres, font=font)[2])
lenOut = max(lenOut, draw.textbbox((0, 0), outres, font=font)[2])
maxGroupWidth = max(maxGroupWidth,draw.textsize(group,font=font)[0])
maxRemarkWidth = max(maxRemarkWidth,draw.textsize(remark,font=font)[0])
lenIn = max(lenIn, draw.textsize(inres, font=font)[0])
lenOut = max(lenOut, draw.textsize(outres, font=font)[0])
return (maxGroupWidth + 10,maxRemarkWidth + 10,lenIn + 20,lenOut + 20)

def __getMaxWidthStream(self,result):
Expand Down Expand Up @@ -149,8 +149,8 @@ def __deweighting(self,result):

def __getBasePos(self, width, text):
font = self.__font
draw = ImageDraw.Draw(Image.new("RGB", (1, 1), (255, 255, 255)))
textSize = draw.textbbox((0, 0), text, font=font)[2]
draw = ImageDraw.Draw(Image.new("RGB",(1,1),(255,255,255)))
textSize = draw.textsize(text, font=font)[0]
basePos = (width - textSize) / 2
logger.debug("Base Position {}".format(basePos))
return basePos
Expand Down
Loading

0 comments on commit 30fb486

Please sign in to comment.