Allow PNG and WebP tile-based output in addition to JPEG (#622)

This commit is contained in:
Patrick Paskaris
2016-11-13 15:36:43 -05:00
committed by Lovell Fuller
parent 6b426014ad
commit bc84d1e47a
5 changed files with 179 additions and 2 deletions

View File

@@ -285,7 +285,13 @@ const tile = function tile (tile) {
}
}
}
return this;
// Format
if (is.inArray(this.options.formatOut, ['jpeg', 'png', 'webp'])) {
this.options.tileFormat = this.options.formatOut;
} else if (this.options.formatOut !== 'input') {
throw new Error('Invalid tile format ' + this.options.formatOut);
}
return this._updateFormatOut('dz');
};
/**