Merge pull request #6192 from electron/native-image-api-names

Upper case initialisms in nativeImage API
This commit is contained in:
Cheng Zhao 2016-06-23 03:06:42 +00:00 committed by GitHub
commit 75972abc84
2 changed files with 8 additions and 5 deletions

View file

@ -344,14 +344,17 @@ mate::Handle<NativeImage> NativeImage::CreateFromDataURL(
void NativeImage::BuildPrototype( void NativeImage::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("toPng", &NativeImage::ToPNG) .SetMethod("toPNG", &NativeImage::ToPNG)
.SetMethod("toJpeg", &NativeImage::ToJPEG) .SetMethod("toJPEG", &NativeImage::ToJPEG)
.SetMethod("getNativeHandle", &NativeImage::GetNativeHandle) .SetMethod("getNativeHandle", &NativeImage::GetNativeHandle)
.SetMethod("toDataURL", &NativeImage::ToDataURL) .SetMethod("toDataURL", &NativeImage::ToDataURL)
.SetMethod("isEmpty", &NativeImage::IsEmpty) .SetMethod("isEmpty", &NativeImage::IsEmpty)
.SetMethod("getSize", &NativeImage::GetSize) .SetMethod("getSize", &NativeImage::GetSize)
.SetMethod("setTemplateImage", &NativeImage::SetTemplateImage) .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 } // namespace api

View file

@ -127,11 +127,11 @@ Creates a new `nativeImage` instance from `dataURL`.
The following methods are available on instances of `nativeImage`: 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. Returns a [Buffer][buffer] that contains the image's `PNG` encoded data.
### `image.toJpeg(quality)` ### `image.toJPEG(quality)`
* `quality` Integer (**required**) - Between 0 - 100. * `quality` Integer (**required**) - Between 0 - 100.