mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
missed adjusting the external memory on resize
This commit is contained in:
parent
dbf2df0ef8
commit
dff99718b9
@ -2067,10 +2067,13 @@ NAN_METHOD(Matrix::Resize) {
|
||||
} else {
|
||||
try{
|
||||
Matrix *self = Nan::ObjectWrap::Unwrap<Matrix>(info.This());
|
||||
int oldSize = self->mat.rows * self->mat.cols * self->mat.elemSize();
|
||||
cv::Mat res = cv::Mat(x, y, CV_32FC3);
|
||||
cv::resize(self->mat, res, cv::Size(x, y), 0, 0, interpolation);
|
||||
~self->mat;
|
||||
self->mat = res;
|
||||
int newSize = self->mat.rows * self->mat.cols * self->mat.elemSize();
|
||||
Nan::AdjustExternalMemory(newSize - oldSize);
|
||||
} catch (...){
|
||||
return Nan::ThrowError("c++ Exception processing resize");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user