Skip to content

Commit

Permalink
修复部分webp保存png失效
Browse files Browse the repository at this point in the history
  • Loading branch information
tonquer committed Dec 3, 2023
1 parent f36c41e commit 0b16572
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
UpdateUrl3Back = "https://hub.fastgit.xyz/tonquer/JMComic-qt"

UpdateVersion = "v1.1.8"
RealVersion = "v1.1.8"
RealVersion = "v1.1.8.1"
VersionTime = "2023-11-22"

Waifu2xVersion = "1.1.6"
Expand Down
2 changes: 1 addition & 1 deletion src/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
socket.close()
app.quit()
Log.Warn("server already star")
exit(1)
sys.exit(1)

localServer = QLocalServer() # 没有实例运行,创建服务器
localServer.listen(serverName)
Expand Down
5 changes: 3 additions & 2 deletions src/tools/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,13 +913,14 @@ def SegmentationPicture(imgData, epsId, scramble_id, bookId):
@staticmethod
def SegmentationPictureToDisk(imgData, epsId, scramble_id, bookId, path, toFormat):
num = ToolUtil.GetSegmentationNum(epsId, scramble_id, bookId)
if num <= 1:
return imgData

from PIL import Image
from io import BytesIO
src = BytesIO(imgData)
srcImg = Image.open(src)
if num <= 1:
srcImg.save(path, toFormat)
return

size = (width, height) = srcImg.size
desImg = Image.new(srcImg.mode, size)
Expand Down

0 comments on commit 0b16572

Please sign in to comment.