From 207d950a6cbc19caf0f75c6ca9f94c9c21898f4c Mon Sep 17 00:00:00 2001 From: bjcscat <87087344+bjcscat@users.noreply.github.com> Date: Mon, 27 Jun 2022 21:58:42 -0500 Subject: [PATCH] set reoptimize to override input GCT (#287) --- natives/caption.cc | 2 +- natives/caption2.cc | 2 +- natives/crop.cc | 2 +- natives/flag.cc | 2 +- natives/gamexplain.cc | 2 +- natives/meme.cc | 2 +- natives/reddit.cc | 2 +- natives/snapchat.cc | 2 +- natives/uncaption.cc | 2 +- natives/watermark.cc | 2 +- natives/whisper.cc | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/natives/caption.cc b/natives/caption.cc index ecb68dd..bd35bd8 100644 --- a/natives/caption.cc +++ b/natives/caption.cc @@ -62,7 +62,7 @@ Napi::Value Caption(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); vips_thread_shutdown(); diff --git a/natives/caption2.cc b/natives/caption2.cc index 446a030..36cf43c 100644 --- a/natives/caption2.cc +++ b/natives/caption2.cc @@ -66,7 +66,7 @@ Napi::Value CaptionTwo(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); vips_thread_shutdown(); diff --git a/natives/crop.cc b/natives/crop.cc index 8072434..782af93 100644 --- a/natives/crop.cc +++ b/natives/crop.cc @@ -48,7 +48,7 @@ Napi::Value Crop(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); vips_thread_shutdown(); diff --git a/natives/flag.cc b/natives/flag.cc index 4115f29..b26be47 100644 --- a/natives/flag.cc +++ b/natives/flag.cc @@ -56,7 +56,7 @@ Napi::Value Flag(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); Napi::Object result = Napi::Object::New(env); result.Set("data", Napi::Buffer::Copy(env, (char *)buf, length)); diff --git a/natives/gamexplain.cc b/natives/gamexplain.cc index d93ac25..bb3aabf 100644 --- a/natives/gamexplain.cc +++ b/natives/gamexplain.cc @@ -49,7 +49,7 @@ Napi::Value Gamexplain(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); vips_thread_shutdown(); diff --git a/natives/meme.cc b/natives/meme.cc index b9b40f1..a8443a0 100644 --- a/natives/meme.cc +++ b/natives/meme.cc @@ -128,7 +128,7 @@ Napi::Value Meme(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); vips_thread_shutdown(); diff --git a/natives/reddit.cc b/natives/reddit.cc index 7f36322..41bc4fb 100644 --- a/natives/reddit.cc +++ b/natives/reddit.cc @@ -59,7 +59,7 @@ Napi::Value Reddit(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); vips_thread_shutdown(); diff --git a/natives/snapchat.cc b/natives/snapchat.cc index c24c2fc..18bb5d2 100644 --- a/natives/snapchat.cc +++ b/natives/snapchat.cc @@ -67,7 +67,7 @@ Napi::Value Snapchat(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); vips_thread_shutdown(); diff --git a/natives/uncaption.cc b/natives/uncaption.cc index d7bea0f..95cdb39 100644 --- a/natives/uncaption.cc +++ b/natives/uncaption.cc @@ -52,7 +52,7 @@ Napi::Value Uncaption(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); vips_thread_shutdown(); diff --git a/natives/watermark.cc b/natives/watermark.cc index b2cdec0..cdac5cb 100644 --- a/natives/watermark.cc +++ b/natives/watermark.cc @@ -154,7 +154,7 @@ Napi::Value Watermark(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); vips_thread_shutdown(); diff --git a/natives/whisper.cc b/natives/whisper.cc index 2925db0..12c9dff 100644 --- a/natives/whisper.cc +++ b/natives/whisper.cc @@ -81,7 +81,7 @@ Napi::Value Whisper(const Napi::CallbackInfo &info) { size_t length; final.write_to_buffer( ("." + type).c_str(), &buf, &length, - type == "gif" ? VImage::option()->set("dither", 0) : 0); + type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) : 0); vips_thread_shutdown();