zhangyuanwei / node-images

Cross-platform image decoder(png/jpeg/gif) and encoder(png/jpeg) for Nodejs
https://npmjs.org/package/images
MIT License
1.55k stars 204 forks source link

Beyond the pixel size limit一般是什么原因导致的 #227

Open yajore opened 3 years ago

yajore commented 3 years ago

{ Error [50030]: ../src/Image.cc:805 Beyond the pixel size limit.../src/Image.cc:810 Out of memory.../src/Image.cc:818 Out of memory.: first argument must be a buffer.../src/Image.cc:580 Unknow format../src/Image.cc:974 Beyond the width limit.../src/Image.cc:984 Out of memory.../src/Image.cc:1023 Beyond the height limit.../src/Image.cc:1064 Beyond the width limit.../src/Image.cc:1069 Beyond the height limit.static napi_value* Image::ToBuffer(napi_env, napi_callback_info)static napi_value Image::DrawImage(napi_env, napi_callback_info)static napi_value__ Image::CopyFromImage(napi_env, napi_callback_info)static napi_value* Image::LoadFromBuffer(napi_env, napi_callback_info)static napi_value Image::FillColor(napi_env, napi_callback_info)static napi_value__ Image::GetTransparent(napi_env, napi_callback_info)

yajore commented 3 years ago

图片大小:1.61 MB 750*12595 const file = fs.readFileSync(__dirname + "\1.jpg"); 读取直接就报错了,image是二进制的图片数据 let origin = images(image);

Stitch-Taotao commented 3 years ago

同样Beyond the pixel size limit
不过Error信息不同:

Error: C:\Users\xiang\Work\node-images\src\Image.cc:805 Beyond the pixel size limit.C:\Users\xiang\Work\node-images\src\Image.cc:810 Out of memory.C:\Users\xiang\Work\node-images\src\Image.cc:818 Out of memory.C:\Users\xiang\Work\node-images\src\Image.cc:974 Beyond the width limit.C:\Users\xiang\Work\node-images\src\Image.cc:984 Out of memory.C:\Users\xiang\Work\node-images\src\Image.cc:1023 Beyond the height limit.C:\Users\xiang\Work\node-images\src\Image.cc:1064 Beyond the width limit.C:\Users\xiang\Work\node-images\src\Image.cc:1069 Beyond the height limit.�?�o@�C33��<3��3�unknown exception�J3��<3�M,3��@3��<3�M,3�bad array new lengthbicubicboxvector too long���;�>?�?Ch�cFߑ?�?C:\Users
at WrappedImage.loadFromBuffer (D:\ZZZCodingFile\TS学习\Study002\node_modules\images\index.js:56:22)
    at WrappedImage.loadFromBuffer (D:\ZZZCodingFile\TS学习\Study002\node_modules\images\index.js:149:34)
    at Function.images.loadFromBuffer (D:\ZZZCodingFile\TS学习\Study002\node_modules\images\index.js:221:27)
    at Function.images.loadFromFile (D:\ZZZCodingFile\TS学习\Study002\node_modules\images\index.js:213:19)
    at images (D:\ZZZCodingFile\TS学习\Study002\node_modules\images\index.js:179:24)
    at Object.<anonymous> (D:\ZZZCodingFile\TS学习\Study002\index.js:2:11)
79229788 commented 2 years ago

需要用images.setLimit()来更新最大限制,默认的max是10240像素,所以会报错,但是images.setLimit这个接口无效,还在等作者修复o(╥﹏╥)o

dasheng523 commented 2 years ago

望重视一下啊,这默认值太小了,处理大一点的图根本行不通。

xinglai-orange commented 2 years ago

Not solved yet. The default limit modified by images.setlimit is still invalid