Sharp: Error on resizing animated gif

Created on 25 Jul 2015  路  9Comments  路  Source: lovell/sharp

I got the error Unsupported ouput __input while I was trying to resize an animated gif via this code.

var sharp = require('sharp');
inputGIF.pipe(sharp().resize(width,height)).pipe(output);

_P/s. I've just installed sharp yesterday_

question

Most helpful comment

I'd recommend using gifsicle for resizing gifs, especially animated ones. I've found that GraphicsMagick and ImageMagick both screw up certain exotic features. (I'm basing that on having run an internal image r'n'r service used by 400.000 users where arbitrary user-uploaded images are processed.)

There's a node.js stream wrapper for gifsicle here: https://www.npmjs.com/package/gifsicle-stream

All 9 comments

Hi Lewis, I guess you discovered that GIF output is unsupported. (For animated GIF input, only the first frame is used.)

I used 'gm' lib before which could resize animated gif銆侭ut 'gm' depends on 'imagemagic' that is so big and very difficult to be installed on my server.

Are animated GIFs still unsupported by Sharp?

@zilions GIF output is unsupported.

this isn't very well documented anywhere

@prmichaelsen PRs to update docs are always welcome.

I'd recommend using gifsicle for resizing gifs, especially animated ones. I've found that GraphicsMagick and ImageMagick both screw up certain exotic features. (I'm basing that on having run an internal image r'n'r service used by 400.000 users where arbitrary user-uploaded images are processed.)

There's a node.js stream wrapper for gifsicle here: https://www.npmjs.com/package/gifsicle-stream

@lovell Libvips seems to have GIF support now. Can it work with sharp? https://github.com/libvips/libvips/issues/1167

@adityapatadia Please see #1372

Was this page helpful?
0 / 5 - 0 ratings