Use FreeCallback to support mixed Windows runtime libs #152

This commit is contained in:
Lovell Fuller
2015-11-14 13:58:05 +00:00
parent ede2ee9ce3
commit 2678d761ba
6 changed files with 37 additions and 6 deletions

11
src/metadata.cc Executable file → Normal file
View File

@@ -35,6 +35,7 @@ using sharp::InitImage;
using sharp::HasProfile;
using sharp::HasAlpha;
using sharp::ExifOrientation;
using sharp::FreeCallback;
using sharp::counterQueue;
struct MetadataBaton {
@@ -175,10 +176,16 @@ class MetadataWorker : public AsyncWorker {
Set(info, New("orientation").ToLocalChecked(), New<Number>(baton->orientation));
}
if (baton->exifLength > 0) {
Set(info, New("exif").ToLocalChecked(), NewBuffer(baton->exif, baton->exifLength).ToLocalChecked());
Set(info,
New("exif").ToLocalChecked(),
NewBuffer(baton->exif, baton->exifLength, FreeCallback, nullptr).ToLocalChecked()
);
}
if (baton->iccLength > 0) {
Set(info, New("icc").ToLocalChecked(), NewBuffer(baton->icc, baton->iccLength).ToLocalChecked());
Set(info,
New("icc").ToLocalChecked(),
NewBuffer(baton->icc, baton->iccLength, FreeCallback, nullptr).ToLocalChecked()
);
}
argv[1] = info;
}