mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure animated GIF output is optimised #2376
This commit is contained in:
@@ -782,6 +782,8 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
sharp::AssertImageTypeDimensions(image, sharp::ImageType::GIF);
|
||||
VipsArea *area = VIPS_AREA(image.magicksave_buffer(VImage::option()
|
||||
->set("strip", !baton->withMetadata)
|
||||
->set("optimize_gif_frames", TRUE)
|
||||
->set("optimize_gif_transparency", TRUE)
|
||||
->set("format", "gif")));
|
||||
baton->bufferOut = static_cast<char*>(area->data);
|
||||
baton->bufferOutLength = area->length;
|
||||
@@ -925,6 +927,8 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
sharp::AssertImageTypeDimensions(image, sharp::ImageType::GIF);
|
||||
image.magicksave(const_cast<char*>(baton->fileOut.data()), VImage::option()
|
||||
->set("strip", !baton->withMetadata)
|
||||
->set("optimize_gif_frames", TRUE)
|
||||
->set("optimize_gif_transparency", TRUE)
|
||||
->set("format", "gif"));
|
||||
baton->formatOut = "gif";
|
||||
} else if (baton->formatOut == "tiff" || (mightMatchInput && isTiff) ||
|
||||
|
||||
Reference in New Issue
Block a user