图像超过长度问题
LuckySJTU opened this issue · comments
在运行时提示Maximum supported image dimension is 65500 pixels
随后报错,错误信息
Traceback (most recent call last):
File "C:\Users\user\.conda\envs\bot\lib\site-packages\PIL\ImageFile.py", line 536, in _save
fh = fp.fileno()
io.UnsupportedOperation: fileno
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\user\.conda\envs\bot\lib\site-packages\nonebot_plugin_remake\__init__.py", line 149, in _
img = await get_life_img(talents, init_prop, results, summary)
File "C:\Users\user\.conda\envs\bot\lib\site-packages\nonebot\utils.py", line 195, in _wrapper
result = await loop.run_in_executor(None, partial(context.run, pfunc))
File "C:\Users\user\.conda\envs\bot\lib\concurrent\futures\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Users\user\.conda\envs\bot\lib\site-packages\nonebot_plugin_remake\__init__.py", line 163, in get_life_img
return save_jpg(draw_life(talents, init_prop, results, summary))
**File "C:\Users\user\.conda\envs\bot\lib\site-packages\nonebot_plugin_remake\drawer.py", line 366, in save_jpg**
**img.convert("RGB").save(output, format="jpeg")**
File "C:\Users\user\.conda\envs\bot\lib\site-packages\PIL\Image.py", line 2439, in save
save_handler(self, fp, filename)
File "C:\Users\user\.conda\envs\bot\lib\site-packages\PIL\JpegImagePlugin.py", line 824, in _save
ImageFile._save(im, fp, [("jpeg", (0, 0) + im.size, 0, rawmode)], bufsize)
File "C:\Users\user\.conda\envs\bot\lib\site-packages\PIL\ImageFile.py", line 540, in _save
_encode_tile(im, fp, tile, bufsize, None, exc)
File "C:\Users\user\.conda\envs\bot\lib\site-packages\PIL\ImageFile.py", line 567, in _encode_tile
raise _get_oserror(errcode, encoder=True) from exc
OSError: broken data stream when writing image file
看到最终输出的图像高度为69000左右,似乎是超过了图像的最大高度限制?
似乎是 jpg 有高度限制
我觉得可能得调整一下图片排布,不然太长也不好看
感谢,期待更新
可以的,好猛的300岁