- 已编辑
进一步的事实核查:
n0099 由js实现的裁剪选区窗口
具体是指的扩展 https://github.com/FriendsOfFlarum/profile-image-crop
追溯上传网络请求的callstack我们可以找到
在这里可以看见上传网络请求的multipart/form-data
的第一个文件的二进制内容来自blob变量,而blob变量又来自L90的canvas.toBlob()
的返回值,根据其文档 https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob 可知由于这里没有额外参数指定使用jpg或webp压缩并提供压缩quality值导致其会直接返回没有压缩的png,这也解释了此前
为什么能够指png为jpg
事实是这问题在扩展用户之中早有预言:
https://discuss.flarum.org/d/18286/28
https://github.com/FriendsOfFlarum/profile-image-crop/issues/15
并早已有人修复了这个问题并在3个月前其pr被merge
https://github.com/FriendsOfFlarum/profile-image-crop/pull/17
但不幸地
由浏览器扩展 https://github.com/refined-github/refined-github 向我提醒的
The merge commit doesn’t appear in any tags
意味着截止2022年11月,这个pr所造成的更改仍未反映在任何github tags及对应的packagist包版本之中
目前这个扩展的最新版本是去年11月发布的1.0.1,其对应的github tags和commit是 https://github.com/FriendsOfFlarum/profile-image-crop/commits/master#:~:text=Remove%20Bazaar%20reference
对于此问题我已致电该扩展repo的有关人士催促其进行一个包流程的发布: https://github.com/FriendsOfFlarum/profile-image-crop/pull/17#issuecomment-1296220944
[right]本站更新记录与bug反馈[/right]