当图片文件扩展名和实际图片格式不符时,输出错误。
Closed this issue · 2 comments
透明哥哥,从一些epub电子书提取的图片,会有一些图片文件扩展名和实际图片格式不符的情况,这种情况模型可以超分,但是输出文件时会报错😂。
希望能够还是按源文件的后缀名(需求是超分后替换到源文件里面的图片,所以希望能够继续按源文件的后缀名输出。——将错就就,哈哈😊)
`Using executable: D:\App\App_totalcmd\SoftDir_program\realesrgan-gui-windows-bundled-v0.2.5.0\realesrgan-ncnn-vulkan.exe
[0 NVIDIA GeForce GTX 1070 Ti] queueC=2[8] queueG=0[16] queueT=1[2]
[0 NVIDIA GeForce GTX 1070 Ti] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[0 NVIDIA GeForce GTX 1070 Ti] fp16-p/s/a=1/1/0 int8-p/s/a=1/1/1
[0 NVIDIA GeForce GTX 1070 Ti] subgroup=32 basic=1 vote=1 ballot=1 shuffle=1
image E:\Download\demo-图片文件扩展名和实际图片格式不符\0.jpg has alpha channel ! E:\Download\demo-图片文件扩展名和实际图片格式不符\0.jpg will output C:\Users\Ben\AppData\Local\Temp\3M5y2sDrxZxUb9BT.jpg.png
0.00%
0.85%
1.71%
2.56%
3.42%
4.27%
5.13%
5.98%
6.84%
7.69%
8.55%
9.40%
10.26%
11.11%
11.97%
12.82%
13.68%
14.53%
15.38%
16.24%
17.09%
17.95%
18.80%
19.66%
20.51%
21.37%
22.22%
23.08%
23.93%
24.79%
25.64%
26.50%
27.35%
28.21%
29.06%
29.91%
30.77%
31.62%
32.48%
33.33%
34.19%
35.04%
35.90%
36.75%
37.61%
38.46%
39.32%
40.17%
41.03%
41.88%
42.74%
43.59%
44.44%
45.30%
46.15%
47.01%
47.86%
48.72%
49.57%
50.43%
51.28%
52.14%
52.99%
53.85%
54.70%
55.56%
56.41%
57.26%
58.12%
58.97%
59.83%
60.68%
61.54%
62.39%
63.25%
64.10%
64.96%
65.81%
66.67%
67.52%
68.38%
69.23%
70.09%
70.94%
71.79%
72.65%
73.50%
74.36%
75.21%
76.07%
76.92%
77.78%
78.63%
79.49%
80.34%
81.20%
82.05%
82.91%
83.76%
84.62%
85.47%
86.32%
87.18%
88.03%
88.89%
89.74%
90.60%
91.45%
92.31%
93.16%
94.02%
94.87%
95.73%
96.58%
97.44%
98.29%
99.15%
E:\Download\demo-图片文件扩展名和实际图片格式不符\0.jpg -> C:\Users\Ben\AppData\Local\Temp\3M5y2sDrxZxUb9BT.jpg.png done
Traceback (most recent call last):
File "task.py", line 294, in taskRunner
File "task.py", line 107, in run
File "PIL\Image.py", line 3247, in open
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Ben\AppData\Local\Temp\3M5y2sDrxZxUb9BT.jpg'
`
Real-ESRGAN 有这么一个操作,如果输入文件是有 alpha 通道的图片,但是输出扩展名又是不支持 alpha 通道的 JPG(在 GUI 里批处理的时候碰到这种扩展名 JPG 但是实际格式不是的图片就会出现这种情况),就会继续按 PNG 输出,同时强行给输出的文件名加一个 '.png',导致 GUI 后续的处理找不到文件。
检测到这种情况就重命名回去好了……
太棒了,感谢,enjoy a cup of coffee~ 😘