You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some discussion in #743, but in essence there should be a non-streaming API for all formats with all config options (e.g. quality, PNG filter).
toBuffer(cb: function, mimeType?: string, quality?: number) would parallel toBlob.
toBuffer(cb,"image/jpeg",quality: number);toBuffer(cb,"image/png",compressionLevel: number);// accommodate non-standard options:toBuffer(cb,"image/png",{compressionLevel?: number,filter?: number,palette?: Uint8ClampedArray,backgroundIndex?: number});toBuffer(cb,"image/svg");// throws if not an SVG canvastoBuffer(cb,"raw");// Maybe? No need for this to use a callback as it's just a memcpy.toBuffer(cb,"image/gif");// maybe in the future
Alternatively, @adamhooper proposed separate toPNG/toJPEG functions.
Should there be sync versions that return a value instead of accepting a callback?
See also #934 about cleaning up the PNG filter API.
I can work on this sometime soon. Feedback welcome.
The text was updated successfully, but these errors were encountered:
Some discussion in #743, but in essence there should be a non-streaming API for all formats with all config options (e.g. quality, PNG filter).
toBuffer(cb: function, mimeType?: string, quality?: number)
would paralleltoBlob
.Alternatively, @adamhooper proposed separate
toPNG
/toJPEG
functions.Should there be sync versions that return a value instead of accepting a callback?
See also #934 about cleaning up the PNG filter API.
I can work on this sometime soon. Feedback welcome.
The text was updated successfully, but these errors were encountered: