feat: add safer nativeImage.createFromBitmap(), which does not decode PNG/JPEG (#17337)

This commit is contained in:
Milan Burda 2019-03-14 19:00:38 +01:00 committed by Jeremy Apthorp
parent aa8b66aae1
commit 878538f2e8
4 changed files with 91 additions and 1 deletions

View file

@ -51,6 +51,10 @@ class NativeImage : public mate::Wrappable<NativeImage> {
size_t length);
static mate::Handle<NativeImage> CreateFromPath(v8::Isolate* isolate,
const base::FilePath& path);
static mate::Handle<NativeImage> CreateFromBitmap(
mate::Arguments* args,
v8::Local<v8::Value> buffer,
const mate::Dictionary& options);
static mate::Handle<NativeImage> CreateFromBuffer(
mate::Arguments* args,
v8::Local<v8::Value> buffer);