Skip to content

Commit

Permalink
1.1.6 release
Browse files Browse the repository at this point in the history
commit 5dda98a
Author: Stan Hutcheon <[email protected]>
Date:   Fri May 8 21:37:25 2015 +0100

    Bump to 1.1.6

commit fa063b7
Author: Stan Hutcheon <[email protected]>
Date:   Fri May 8 21:36:28 2015 +0100

    Add extra note about same directory cases

    - readme: Reorder to make sense

commit 2221398
Author: Stan Hutcheon <[email protected]>
Date:   Fri May 8 21:25:31 2015 +0100

    Fixed unset hash variable, broken in 728ccfc

commit 6be1ff1
Author: Stan Hutcheon <[email protected]>
Date:   Fri May 8 21:18:46 2015 +0100

    Update readme to ensure sameDest usage is clear

commit 728ccfc
Author: Stan Hutcheon <[email protected]>
Date:   Fri May 8 21:18:22 2015 +0100

    Removed some callback layers in stream function

    - Added conditional return values in the calc and compare functions to allow this

    - 50 inserts, 50 deletions!

commit f373ed5
Author: Stan Hutcheon <[email protected]>
Date:   Thu May 7 22:09:42 2015 +0100

    Add logic for same source/destination

commit 2a5c897
Author: Stan Hutcheon <[email protected]>
Date:   Fri May 1 14:10:39 2015 +0100

    Remove checkSigs option, object restructuring

    - Some object re-structure to make it easier to move to a standalone lib, and to adhere to 'normal' class fundamentals
    - Added further tests
  • Loading branch information
stnvh committed May 8, 2015
1 parent c6a2548 commit db94805
Show file tree
Hide file tree
Showing 6 changed files with 321 additions and 248 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ node_js:
- "0.11"
- "0.10"
- "iojs"
- "iojs-v1.0.4"
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,21 @@ Default: `''`

Your TinyPNG API key to use for requests

#### options.checkSigs
Type: `Boolean`
Default: `false`
#### options.sigFile
Type: `String`
Default: `''`

Whether or not to compare existing source file md5 signatures against those found in the options.sigFile json data. When the signatures match, the file is skipped from being minified again, allowing you to better stay within your API request limits. When an image is minified, and options.checkSigs is true, the md5 signature is determined from the unminified source image and written to the file at options.sigFile (a suggested location would be somewhere under your source control).
If set to a filename, it will compare existing source file md5 signatures against those found in the file's json data. When the signatures match, the file is skipped from being minified again, allowing you to better stay within your API request limits. When an image is minified, the md5 signature is determined from the unminified source image and written to the file at options.sigFile (a suggested location would be somewhere under your source control).

Signatures are based off the unminified source image, so that when the source changes it will be re-minified and re-written to the destination file.

#### options.sigFile
Type: `String`
Default: `''`
#### options.sameDest
Type: `Boolean`
Default `false`

If your source is the same as your destination (images are written over themselves), and you want to use the signature checking feature, set this to true

The file location to write the source image md5 signatures to when using the options.checkSigs option
>**Note:** If your source and destination are the same, it's recommended you use this, and `options.sigFile`, as it prevents you from continually uploading already compressed images each time you run the task
#### options.log
Type: `Boolean`
Expand Down Expand Up @@ -105,6 +107,11 @@ Same as `options.force` except ignores files if the glob is matched

`--ignore` flag on the command line

###Deprecated/non-functional options

**options.checkSigs** - Removed in favor of `options.sigFile`


## License

MIT © Stan Hutcheon - Bigfork Ltd.
Expand Down
5 changes: 2 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ var gulp = require('gulp'),
gulp.task('tinypng', function() {
gulp.src(cwd + '/test/assets/image.png')
.pipe(tinypng({
key: process.env.TINYPNG_KEY || 'NAoMjq0UjjWuLwVAAn9iVtGepjD38pDm',
key: process.env.TINYPNG_KEY || 'rlDAQuwa4AOtQPaekNpu-HgLOedHXOlh',
log: true,
checkSigs: sigs ? true : false,
sigFile: sigs ? '.sigs' : false
sigFile: (sigs ? '.sigs' : false)
}).on('error', function(err) {
console.error(err.message);
}))
Expand Down
Loading

0 comments on commit db94805

Please sign in to comment.