We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python代码
我要反馈的bug无需验证/不方便验证
#!/usr/bin/env python3 import sys import jmcomic args = sys.argv[1:] option = jmcomic.JmOption.construct( { "dir_rule": {"base_dir": "/somewhere/jm"}, "download": {"image": {"suffix": ".jpg"}}, "plugins": { "after_album": [ { "plugin": "img2pdf", "kwargs": { "pdf_dir": "/somewhere/jm", "filename_rule": "Aname", }, } ] }, }, cover_default=True, ) for arg in args: print("Downloading %s..." % arg) jmcomic.download_album(arg, option) print("All downloads finished")
下载的是 615508
615508
产生报错
[2024-10-09 08:20:57] [MainThread]:【plugin.error】插件 [img2pdf],运行遇到未捕获异常,异常信息: [cannot read input image (not jpeg2000). PIL: error reading image: cannot identify image file <_io.BytesIO object at 0x1059d0720>] Traceback (most recent call last): File "/Users/someone/.rye/py/[email protected]/lib/python3.12/site-packages/img2pdf.py", line 1817, in read_images imgdata = Image.open(im) ^^^^^^^^^^^^^^ File "/Users/someone/.rye/py/[email protected]/lib/python3.12/site-packages/PIL/Image.py", line 3498, in open raise UnidentifiedImageError(msg) PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x1059d0720> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/someone/.rye/py/[email protected]/lib/python3.12/site-packages/jmcomic/jm_option.py", line 546, in call_all_plugin self.invoke_plugin(pclass, kwargs, extra, pinfo) File "/Users/someone/.rye/py/[email protected]/lib/python3.12/site-packages/jmcomic/jm_option.py", line 589, in invoke_plugin self.handle_plugin_unexpected_error(e, pinfo, kwargs, plugin, pclass) File "/Users/someone/.rye/py/[email protected]/lib/python3.12/site-packages/jmcomic/jm_option.py", line 619, in handle_plugin_unexpected_error raise e File "/Users/someone/.rye/py/[email protected]/lib/python3.12/site-packages/jmcomic/jm_option.py", line 577, in invoke_plugin plugin.invoke(**kwargs) File "/Users/someone/.rye/py/[email protected]/lib/python3.12/site-packages/jmcomic/jm_plugin.py", line 766, in invoke img_path_ls, img_dir_ls = self.write_img_2_pdf(pdf_filepath, album, photo) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/someone/.rye/py/[email protected]/lib/python3.12/site-packages/jmcomic/jm_plugin.py", line 790, in write_img_2_pdf f.write(img2pdf.convert(img_path_ls)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/someone/.rye/py/[email protected]/lib/python3.12/site-packages/img2pdf.py", line 2733, in convert ) in read_images( ^^^^^^^^^^^^ File "/Users/someone/.rye/py/[email protected]/lib/python3.12/site-packages/img2pdf.py", line 1829, in read_images raise ImageOpenError( img2pdf.ImageOpenError: cannot read input image (not jpeg2000). PIL: error reading image: cannot identify image file <_io.BytesIO object at 0x1059d0720> All downloads finished
看报错估计是下载下来的图片格式问题,或者img2pdf库的问题(?
The text was updated successfully, but these errors were encountered:
我使用你的代码直接运行成功了,没有报错
Sorry, something went wrong.
你看看下载下来的图片是否有空白图
我看了一下,图片都不是空的,检查了一下包的版本,也都是最新的
我等会试一下直接在repl里用img2pdf处理能不能复现
好像是img2pdf库的问题,我直接用PIL的Image.open,输入图片路径不会有问题,img2pdf是读成ByteIO再放到PIL的Image.open的,这个库也很久没维护了,可能在mac上不兼容新版本的PIL了?
No branches or pull requests
注意事项
发生Bug时,你的使用方式?
Python代码
你是否在禁漫官方网页或APP,验证过相应的功能是正常的?
我要反馈的bug无需验证/不方便验证
option配置+源码/命令
下载的是
615508
你预期的结果,与实际结果的差别
产生报错
其他信息
看报错估计是下载下来的图片格式问题,或者img2pdf库的问题(?
The text was updated successfully, but these errors were encountered: