mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Added check for mats.empty() on failed image load.
This commit is contained in:
parent
2e48ea0a61
commit
cfeb82d9fc
@ -81,6 +81,10 @@ NAN_METHOD(OpenCV::ReadImageMulti) {
|
||||
if (info[0]->IsString()) {
|
||||
std::string filename = std::string(*Nan::Utf8String(info[0]->ToString()));
|
||||
cv::imreadmulti(filename, mats);
|
||||
|
||||
if (mats.empty()) {
|
||||
argv[0] = Nan::Error("Error loading file");
|
||||
}
|
||||
}
|
||||
} catch (cv::Exception& e) {
|
||||
argv[0] = Nan::Error(e.what());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user