image-clipper
image-clipper copied to clipboard
Strange error on crop
Following the example on the README.md, in node 12.9.1 with the following package dependencies. Program is fine with Clipper.configure(canvas: canvas) and otherwise, but crashes when I add the crop command...
"dependencies": {
"@tensorflow/tfjs-node": "^1.5.1",
"canvas": "^2.6.1",
"esm": "^3.2.25",
"face-api.js": "^0.22.0",
"image-clipper": "^0.4.4"
}
FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.
1: 0x100078bbb node::Abort() [/Users/me/.nvm/versions/node/v12.9.1/bin/node]
2: 0x100078d3f node::OnFatalError(char const*, char const*) [/Users/me/.nvm/versions/node/v12.9.1/bin/node]
3: 0x100170710 v8::V8::ToLocalEmpty() [/Users/me/.nvm/versions/node/v12.9.1/bin/node]
4: 0x102ded35f Image::SetSource(Nan::FunctionCallbackInfo<v8::Value> const&) [/Users/me/git/facecrop/node_modules/canvas/build/Release/canvas.node]
5: 0x102dcb9c8 Nan::imp::FunctionCallbackWrapper(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/me/git/facecrop/node_modules/canvas/build/Release/canvas.node]
6: 0x1001d8cc0 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/me/.nvm/versions/node/v12.9.1/bin/node]
7: 0x1001d82f1 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/me/.nvm/versions/node/v12.9.1/bin/node]
8: 0x1001d79a0 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/me/.nvm/versions/node/v12.9.1/bin/node]
9: 0x100927c99 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/me/.nvm/versions/node/v12.9.1/bin/node]
error Command failed with signal "SIGABRT".
I'm facing the same issue, but it happens when I send the options
parameter.
"dependencies": {
"canvas": "^2.6.1",
"cookie-parser": "~1.4.4",
"debug": "~2.6.9",
"express": "~4.16.1",
"image-clipper": "^0.4.4",
"lodash": "^4.17.15",
"morgan": "~1.9.1"
}
This is the code that is not working:
clipper(filePath, { quality: 80 })
.crop(0, 0, 256, 512)
.toDataURL(function(dataUrl2) {
console.log('regained the cleared data:', dataUrl2);
});
However, if instead of the "options" parameter I send a function it works:
clipper(filePath, function() {})
.crop(0, 0, 256, 512)
.toDataURL(function(dataUrl2) {
console.log('regained the cleared data:', dataUrl2);
});
Umm, it happens when I use () => {}
, try using function() {}
instead and it works fine.