Comparing version 1.1.1 to 1.2.0
@@ -0,1 +1,11 @@ | ||
<a name="1.2.0"></a> | ||
# [1.2.0](https://github.com/koola/png-image/compare/v1.1.1...v1.2.0) (2017-01-05) | ||
### Features | ||
* **compose:** add writeImage and toBuffer methods ([40a8f95](https://github.com/koola/png-image/commit/40a8f95)) | ||
<a name="1.1.1"></a> | ||
@@ -2,0 +12,0 @@ ## [1.1.1](https://github.com/koola/png-image/compare/v1.1.0...v1.1.1) (2016-12-28) |
@@ -21,2 +21,8 @@ ## Classes | ||
</dd> | ||
<dt><a href="#writeImage">writeImage(instance)</a> ⇒ <code>promise</code></dt> | ||
<dd><p>Writes the image to the filesystem</p> | ||
</dd> | ||
<dt><a href="#toBuffer">toBuffer(instance)</a> ⇒ <code>promise</code></dt> | ||
<dd><p>Writes the image to the filesystem</p> | ||
</dd> | ||
</dl> | ||
@@ -78,1 +84,25 @@ | ||
**Access:** public | ||
<a name="writeImage"></a> | ||
## writeImage(instance) ⇒ <code>promise</code> | ||
Writes the image to the filesystem | ||
**Kind**: global function | ||
**Access:** public | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| instance | <code>this</code> | PNG-image | | ||
<a name="toBuffer"></a> | ||
## toBuffer(instance) ⇒ <code>promise</code> | ||
Writes the image to the filesystem | ||
**Kind**: global function | ||
**Access:** public | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| instance | <code>this</code> | PNG-image | | ||
26
index.js
@@ -82,3 +82,3 @@ 'use strict'; | ||
} | ||
return this._writeImage(this._image, this._imageOutputPath); | ||
return promise.resolve(this); | ||
}); | ||
@@ -181,2 +181,26 @@ } | ||
* | ||
* @method writeImage | ||
* @param {this} instance PNG-image | ||
* @returns {promise} | ||
* @public | ||
*/ | ||
writeImage(instance = this) { | ||
return instance._writeImage(instance._image, instance._imageOutputPath); | ||
} | ||
/** | ||
* Writes the image to the filesystem | ||
* | ||
* @method toBuffer | ||
* @param {this} instance PNG-image | ||
* @returns {promise} | ||
* @public | ||
*/ | ||
toBuffer(instance = this) { | ||
return promise.resolve(PNG.sync.write(instance._image)); | ||
} | ||
/** | ||
* Writes the image to the filesystem | ||
* | ||
* @method _writeImage | ||
@@ -183,0 +207,0 @@ * @param {string} filePath Path to save file |
{ | ||
"name": "png-image", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Crop and save PNGs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21430
247