Code Monkey home page Code Monkey logo

Comments (3)

Kuingsmile avatar Kuingsmile commented on August 15, 2024

好的 我排查下看看

from piclist.

Kuingsmile avatar Kuingsmile commented on August 15, 2024

picgo-plugin-remove-exif包使用了sharp来进行操作,核心代码仅一句:

outputi.buffer = await sharp(b).toBuffer()

测试过程

经过测试,该插件在PicList-Core中可以正常使用,说明问题来自electron环境,在PicList中,具体报错为:

2023-03-09 20:00:48 [PicList ERROR]
------Error Stack Begin------
Error: External buffers are not allowed
-------Error Stack End-------

通过查询sharp和electron的官方项目相关信息,该问题产生的原因来自electron 21.0之后的一次安全性更新,具体可以参考:

简单的来说,electron 21.0中不再允许来自external memory的arraybuffer对象,导致了报错。

The main downside of enabling sandboxed pointers is that ArrayBuffers which point to external ("off-heap") memory are no longer allowed. This means that native modules which rely on this functionality in V8 will need to be refactored to continue working in Electron 20 and later.

由于PicList更新了electron版本至22.0,而PicGo使用的是16.0,因此该插件在PicList中无法正常工作,但PicGo中可以。

另外,sharp 0.31.3版本也修复了这个问题,这也是PicList默认内置的版本,但该插件使用的版本是0.30.7,所以有问题。

解决方案

由于这个插件的功能实现非常简单,而且PicList本身就依赖于sharp,因此下个版本中我会将移除EXIF信息这个功能内置在PicList的图片处理选项中,后续请更新版本,并且不要在PicList内使用该插件,或者让插件作者更新下sharp依赖版本。
@BIMiracle

from piclist.

BIMiracle avatar BIMiracle commented on August 15, 2024

好的,非常感谢讲的十分清楚,学到了

from piclist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.