matplotlib / matplotlib/ipympl
RuntimeError: libpng signaled error
未关闭
还没有人认领这个 Issue。
- 主要语言
- Jupyter Notebook
- 星标
- 1.7k
- 派生
- 234
- PR 合并指标
- 30 天内没有已合并 PR
描述
Sometimes I am getting this error with the trunk version. Not sure what a MWE would be. Has anyone encountered this?
Thanks, Chaffra
RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/ipympl/backend_nbagg.py in _handle_message(self, object, content, buffers)
178 self.manager.resize(w, h)
179 else:
--> 180 self.manager.handle_json(content)
181
182 def send_json(self, content):
/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_webagg_core.py in handle_json(self, content)
437
438 def handle_json(self, content):
--> 439 self.canvas.handle_event(content)
440
441 def refresh_all(self):
/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_webagg_core.py in handle_event(self, event)
238 handler = getattr(self, 'handle_{0}'.format(e_type),
239 self.handle_unknown_event)
--> 240 return handler(event)
241
242 def handle_unknown_event(self, event):
/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_webagg_core.py in handle_draw(self, event)
254
255 def handle_draw(self, event):
--> 256 self.draw()
257
258 def _handle_mouse(self, event):
/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_webagg_core.py in draw(self)
151 super().draw()
152 finally:
--> 153 self.manager.refresh_all() # Swap the frames.
154
155 def draw_idle(self):
/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_webagg_core.py in refresh_all(self)
441 def refresh_all(self):
442 if self.web_sockets:
--> 443 diff = self.canvas.get_diff_image()
444 if diff is not None:
445 for s in self.web_sockets:
/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_webagg_core.py in get_diff_image(self)
199 buff = _png.write_png(
200 output.view(dtype=np.uint8).reshape(output.shape + (4,)),
--> 201 None, compression=6, filter=_png.PNG_FILTER_NONE)
202
203 # Swap the renderer frames
RuntimeError: libpng signaled error
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 ipympl 的 backend_nbagg.py 以及 matplotlib 在 backend_webagg_core.py 中经过 handle_draw()、refresh_all() 和 get_diff_image() 的路径入手,尤其关注 traceback 中显示的 _png.write_png 调用。使用报告中的 Python、ipympl、matplotlib 和 libpng 版本复现该故障,然后定义一个最小示例和回归测试覆盖范围,以证明该错误不再发生。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- jupyter-notebook, python
- 领域
- backend, web-dev
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100