Doc refresh and changelog entry for #2012

This commit is contained in:
Lovell Fuller
2020-08-17 16:20:10 +01:00
parent cb1baede87
commit 341ea3e4ea
8 changed files with 62 additions and 19 deletions

View File

@@ -387,7 +387,9 @@ function webp (options) {
/**
* Use these GIF options for output image.
*
* Requires a custom, globally-installed libvips compiled with support for imageMagick.
* Requires libvips compiled with support for ImageMagick or GraphicsMagick.
* The prebuilt binaries do not include this - see
* {@link https://sharp.pixelplumbing.com/install#custom-libvips installing a custom libvips}.
*
* @param {Object} [options] - output options
* @param {number} [options.pageHeight] - page height for animated output
@@ -398,12 +400,16 @@ function webp (options) {
* @throws {Error} Invalid options
*/
function gif (options) {
if (!this.constructor.format.magick.output.buffer) {
throw new Error('The gif operation requires libvips to have been installed with support for ImageMagick');
}
trySetAnimationOptions(options, this.options);
return this._updateFormatOut('gif', options);
}
/**
* Set animation options if available.
* @private
*
* @param {Object} [source] - output options
* @param {number} [source.pageHeight] - page height for animated output