Demo for query storing
Change-Id: I947bcac841992c3f6cfd01ab337c265b0d01cb70
diff --git a/node_modules/imagemin-gifsicle/index.js b/node_modules/imagemin-gifsicle/index.js
new file mode 100644
index 0000000..5b5a08d
--- /dev/null
+++ b/node_modules/imagemin-gifsicle/index.js
@@ -0,0 +1,41 @@
+'use strict';
+const execBuffer = require('exec-buffer');
+const gifsicle = require('gifsicle');
+const isGif = require('is-gif');
+
+module.exports = opts => buf => {
+ opts = Object.assign({}, opts);
+
+ if (!Buffer.isBuffer(buf)) {
+ return Promise.reject(new TypeError('Expected a buffer'));
+ }
+
+ if (!isGif(buf)) {
+ return Promise.resolve(buf);
+ }
+
+ const args = ['--no-warnings', '--no-app-extensions'];
+
+ if (opts.interlaced) {
+ args.push('--interlace');
+ }
+
+ if (opts.optimizationLevel) {
+ args.push(`--optimize=${opts.optimizationLevel}`);
+ }
+
+ if (opts.colors) {
+ args.push(`--colors=${opts.colors}`);
+ }
+
+ args.push('--output', execBuffer.output, execBuffer.input);
+
+ return execBuffer({
+ input: buf,
+ bin: gifsicle,
+ args
+ }).catch(error => {
+ error.message = error.stderr || error.message;
+ throw error;
+ });
+};