Demo for query storing
Change-Id: I947bcac841992c3f6cfd01ab337c265b0d01cb70
diff --git a/node_modules/jpegtran-bin/cli.js b/node_modules/jpegtran-bin/cli.js
new file mode 100644
index 0000000..a1842cf
--- /dev/null
+++ b/node_modules/jpegtran-bin/cli.js
@@ -0,0 +1,9 @@
+#!/usr/bin/env node
+'use strict';
+const {spawn} = require('child_process');
+const jpegtran = require('.');
+
+const input = process.argv.slice(2);
+
+spawn(jpegtran, input, {stdio: 'inherit'})
+ .on('exit', process.exit);
diff --git a/node_modules/jpegtran-bin/index.js b/node_modules/jpegtran-bin/index.js
new file mode 100644
index 0000000..fb0971d
--- /dev/null
+++ b/node_modules/jpegtran-bin/index.js
@@ -0,0 +1,2 @@
+'use strict';
+module.exports = require('./lib').path();
diff --git a/node_modules/jpegtran-bin/lib/index.js b/node_modules/jpegtran-bin/lib/index.js
new file mode 100644
index 0000000..3d18329
--- /dev/null
+++ b/node_modules/jpegtran-bin/lib/index.js
@@ -0,0 +1,21 @@
+'use strict';
+const path = require('path');
+const BinWrapper = require('bin-wrapper');
+const pkg = require('../package.json');
+
+const url = `https://raw.githubusercontent.com/imagemin/jpegtran-bin/v${pkg.version}/vendor/`;
+
+module.exports = new BinWrapper()
+ .src(`${url}macos/jpegtran`, 'darwin')
+ .src(`${url}linux/x86/jpegtran`, 'linux', 'x86')
+ .src(`${url}linux/x64/jpegtran`, 'linux', 'x64')
+ .src(`${url}freebsd/x86/jpegtran`, 'freebsd', 'x86')
+ .src(`${url}freebsd/x64/jpegtran`, 'freebsd', 'x64')
+ .src(`${url}sunos/x86/jpegtran`, 'sunos', 'x86')
+ .src(`${url}sunos/x64/jpegtran`, 'sunos', 'x64')
+ .src(`${url}win/x86/jpegtran.exe`, 'win32', 'x86')
+ .src(`${url}win/x64/jpegtran.exe`, 'win32', 'x64')
+ .src(`${url}win/x86/libjpeg-62.dll`, 'win32', 'x86')
+ .src(`${url}win/x64/libjpeg-62.dll`, 'win32', 'x64')
+ .dest(path.join(__dirname, '../vendor'))
+ .use(process.platform === 'win32' ? 'jpegtran.exe' : 'jpegtran');
diff --git a/node_modules/jpegtran-bin/lib/install.js b/node_modules/jpegtran-bin/lib/install.js
new file mode 100644
index 0000000..7260baa
--- /dev/null
+++ b/node_modules/jpegtran-bin/lib/install.js
@@ -0,0 +1,37 @@
+'use strict';
+const path = require('path');
+const binBuild = require('bin-build');
+const log = require('logalot');
+const bin = require('.');
+
+const args = [
+ '-copy',
+ 'none',
+ '-optimize',
+ '-outfile',
+ path.join(__dirname, '../test/fixtures/test-optimized.jpg'),
+ path.join(__dirname, '../test/fixtures/test.jpg')
+];
+
+bin.run(args).then(() => {
+ log.success('jpegtran pre-build test passed successfully');
+}).catch(error => {
+ log.warn(error.message);
+ log.warn('jpegtran pre-build test failed');
+ log.info('compiling from source');
+
+ const cfg = [
+ './configure --disable-shared',
+ `--prefix="${bin.dest()}" --bindir="${bin.dest()}"`
+ ].join(' ');
+
+ binBuild.url('https://downloads.sourceforge.net/project/libjpeg-turbo/1.5.1/libjpeg-turbo-1.5.1.tar.gz', [
+ 'touch configure.ac aclocal.m4 configure Makefile.am Makefile.in',
+ cfg,
+ 'make install'
+ ]).then(() => {
+ log.success('jpegtran built successfully');
+ }).catch(error => {
+ log.error(error.stack);
+ });
+});
diff --git a/node_modules/jpegtran-bin/license b/node_modules/jpegtran-bin/license
new file mode 100644
index 0000000..92dec7a
--- /dev/null
+++ b/node_modules/jpegtran-bin/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Imagemin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/jpegtran-bin/package.json b/node_modules/jpegtran-bin/package.json
new file mode 100644
index 0000000..5596fd0
--- /dev/null
+++ b/node_modules/jpegtran-bin/package.json
@@ -0,0 +1,95 @@
+{
+ "_from": "jpegtran-bin@^4.0.0",
+ "_id": "jpegtran-bin@4.0.0",
+ "_inBundle": false,
+ "_integrity": "sha512-2cRl1ism+wJUoYAYFt6O/rLBfpXNWG2dUWbgcEkTt5WGMnqI46eEro8T4C5zGROxKRqyKpCBSdHPvt5UYCtxaQ==",
+ "_location": "/jpegtran-bin",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "jpegtran-bin@^4.0.0",
+ "name": "jpegtran-bin",
+ "escapedName": "jpegtran-bin",
+ "rawSpec": "^4.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^4.0.0"
+ },
+ "_requiredBy": [
+ "/imagemin-jpegtran"
+ ],
+ "_resolved": "https://registry.npmjs.org/jpegtran-bin/-/jpegtran-bin-4.0.0.tgz",
+ "_shasum": "d00aed809fba7aa6f30817e59eee4ddf198f8f10",
+ "_spec": "jpegtran-bin@^4.0.0",
+ "_where": "C:\\Users\\marcr\\Desktop\\KorAp\\Git\\Kalamar\\node_modules\\imagemin-jpegtran",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bin": {
+ "jpegtran": "cli.js"
+ },
+ "bugs": {
+ "url": "https://github.com/imagemin/jpegtran-bin/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "bin-build": "^3.0.0",
+ "bin-wrapper": "^4.0.0",
+ "logalot": "^2.0.0"
+ },
+ "deprecated": false,
+ "description": "jpegtran (part of libjpeg-turbo) bin-wrapper that makes it seamlessly available as a local dependency",
+ "devDependencies": {
+ "ava": "*",
+ "bin-check": "^4.0.1",
+ "compare-size": "^3.0.0",
+ "execa": "^1.0.0",
+ "tempy": "^0.2.1",
+ "xo": "*"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "files": [
+ "index.js",
+ "cli.js",
+ "lib",
+ "test"
+ ],
+ "homepage": "https://github.com/imagemin/jpegtran-bin#readme",
+ "keywords": [
+ "imagemin",
+ "compress",
+ "image",
+ "img",
+ "jpeg",
+ "jpg",
+ "minify",
+ "optimize",
+ "jpegtran"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "Kevin Mårtensson",
+ "email": "kevinmartensson@gmail.com",
+ "url": "github.com/kevva"
+ },
+ {
+ "name": "Shinnosuke Watanabe",
+ "url": "github.com/shinnn"
+ }
+ ],
+ "name": "jpegtran-bin",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/imagemin/jpegtran-bin.git"
+ },
+ "scripts": {
+ "postinstall": "node lib/install.js",
+ "test": "xo && ava"
+ },
+ "version": "4.0.0"
+}
diff --git a/node_modules/jpegtran-bin/readme.md b/node_modules/jpegtran-bin/readme.md
new file mode 100644
index 0000000..fc3b260
--- /dev/null
+++ b/node_modules/jpegtran-bin/readme.md
@@ -0,0 +1,40 @@
+# jpegtran-bin [](https://travis-ci.org/imagemin/jpegtran-bin)
+
+> [libjpeg-turbo](http://libjpeg-turbo.virtualgl.org/) is a derivative of libjpeg that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64, and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as the unmodified version of libjpeg, all else being equal.
+
+You probably want [`imagemin-jpegtran`](https://github.com/imagemin/imagemin-jpegtran) instead.
+
+
+## Install
+
+```
+$ npm install --save jpegtran-bin
+```
+
+
+## Usage
+
+```js
+var execFile = require('child_process').execFile;
+var jpegtran = require('jpegtran-bin');
+
+execFile(jpegtran, ['-outfile', 'output.jpg', 'input.jpg'], function (err) {
+ console.log('Image minified!');
+});
+```
+
+
+## CLI
+
+```
+$ npm install --global jpegtran-bin
+```
+
+```
+$ jpegtran --help
+```
+
+
+## License
+
+MIT © [Imagemin](https://github.com/imagemin)
diff --git a/node_modules/jpegtran-bin/test/fixtures/test-optimized.jpg b/node_modules/jpegtran-bin/test/fixtures/test-optimized.jpg
new file mode 100644
index 0000000..22f4cfd
--- /dev/null
+++ b/node_modules/jpegtran-bin/test/fixtures/test-optimized.jpg
Binary files differ
diff --git a/node_modules/jpegtran-bin/test/fixtures/test.jpg b/node_modules/jpegtran-bin/test/fixtures/test.jpg
new file mode 100644
index 0000000..831b437
--- /dev/null
+++ b/node_modules/jpegtran-bin/test/fixtures/test.jpg
Binary files differ
diff --git a/node_modules/jpegtran-bin/test/test.js b/node_modules/jpegtran-bin/test/test.js
new file mode 100644
index 0000000..95754be
--- /dev/null
+++ b/node_modules/jpegtran-bin/test/test.js
@@ -0,0 +1,45 @@
+'use strict';
+const fs = require('fs');
+const path = require('path');
+const test = require('ava');
+const execa = require('execa');
+const tempy = require('tempy');
+const binCheck = require('bin-check');
+const binBuild = require('bin-build');
+const compareSize = require('compare-size');
+const jpegtran = require('..');
+
+test('rebuild the jpegtran binaries', async t => {
+ const tmp = tempy.directory();
+ const cfg = [
+ './configure --disable-shared',
+ `--prefix="${tmp}" --bindir="${tmp}"`
+ ].join(' ');
+
+ await binBuild.url('https://downloads.sourceforge.net/project/libjpeg-turbo/1.5.1/libjpeg-turbo-1.5.1.tar.gz', [
+ cfg,
+ 'make install'
+ ]);
+
+ t.true(fs.existsSync(path.join(tmp, 'jpegtran')));
+});
+
+test('return path to binary and verify that it is working', async t => {
+ t.true(await binCheck(jpegtran, ['-version']));
+});
+
+test('minify a JPG', async t => {
+ const tmp = tempy.directory();
+ const src = path.join(__dirname, 'fixtures/test.jpg');
+ const dest = path.join(tmp, 'test.jpg');
+ const args = [
+ '-outfile',
+ dest,
+ src
+ ];
+
+ await execa(jpegtran, args);
+ const res = await compareSize(src, dest);
+
+ t.true(res[dest] < res[src]);
+});
diff --git a/node_modules/jpegtran-bin/vendor/jpegtran.exe b/node_modules/jpegtran-bin/vendor/jpegtran.exe
new file mode 100644
index 0000000..578df06
--- /dev/null
+++ b/node_modules/jpegtran-bin/vendor/jpegtran.exe
Binary files differ
diff --git a/node_modules/jpegtran-bin/vendor/libjpeg-62.dll b/node_modules/jpegtran-bin/vendor/libjpeg-62.dll
new file mode 100644
index 0000000..1934c16
--- /dev/null
+++ b/node_modules/jpegtran-bin/vendor/libjpeg-62.dll
Binary files differ