From e9222583cbd354559ec0ab0bb1170567c2ec9d73 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Jun 2016 15:46:22 -0700 Subject: [PATCH] toPng/toJpeg -> toPNG/toJPEG --- atom/common/api/atom_api_native_image.cc | 9 ++++++--- docs/api/native-image.md | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index c0b51ba..b666f86 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -344,14 +344,17 @@ mate::Handle NativeImage::CreateFromDataURL( void NativeImage::BuildPrototype( v8::Isolate* isolate, v8::Local prototype) { mate::ObjectTemplateBuilder(isolate, prototype) - .SetMethod("toPng", &NativeImage::ToPNG) - .SetMethod("toJpeg", &NativeImage::ToJPEG) + .SetMethod("toPNG", &NativeImage::ToPNG) + .SetMethod("toJPEG", &NativeImage::ToJPEG) .SetMethod("getNativeHandle", &NativeImage::GetNativeHandle) .SetMethod("toDataURL", &NativeImage::ToDataURL) .SetMethod("isEmpty", &NativeImage::IsEmpty) .SetMethod("getSize", &NativeImage::GetSize) .SetMethod("setTemplateImage", &NativeImage::SetTemplateImage) - .SetMethod("isTemplateImage", &NativeImage::IsTemplateImage); + .SetMethod("isTemplateImage", &NativeImage::IsTemplateImage) + // TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings + .SetMethod("toPng", &NativeImage::ToPNG) + .SetMethod("toJpeg", &NativeImage::ToJPEG); } } // namespace api diff --git a/docs/api/native-image.md b/docs/api/native-image.md index d2a2926..f031785 100644 --- a/docs/api/native-image.md +++ b/docs/api/native-image.md @@ -127,11 +127,11 @@ Creates a new `nativeImage` instance from `dataURL`. The following methods are available on instances of `nativeImage`: -### `image.toPng()` +### `image.toPNG()` Returns a [Buffer][buffer] that contains the image's `PNG` encoded data. -### `image.toJpeg(quality)` +### `image.toJPEG(quality)` * `quality` Integer (**required**) - Between 0 - 100. -- 2.7.4