axe312ger / sqip

"SQIP" (pronounced \skwɪb\ like the non-magical folk of magical descent) is a SVG-based LQIP technique.
http://axe312ger.github.io/sqip
The Unlicense
3.37k stars 82 forks source link

Error message when passing input as a Buffer. #292

Closed AdleyJulian closed 8 months ago

AdleyJulian commented 1 year ago

I had thought that the output was optional for the Node API usage like in the CLI.

I kept getting the message "Error: undefined is required when passing image as buffer". There's a check for the output file name if the input is a buffer.

I think this should be replaced

        if (Buffer.isBuffer(input)) {
            if (!outputFileName) {
                throw new Error(`${outputFileName} is required when passing image as buffer`);
            }

with this

        if (Buffer.isBuffer(input)) {
            if (!outputFileName) {
                throw new Error("OutputFileName is required when passing image as buffer");
            }
axe312ger commented 1 year ago

Can you provide a pull request please?

axe312ger commented 8 months ago

This is fixed and released :)