Skip to content

Commit ebc87e3

Browse files
committed
fix: remove sharpening for png format
1 parent 90de5ba commit ebc87e3

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<img src="http://52.209.207.148/assets/products/dadi-cdn-full.png" alt="DADI CDN" height="65"/>
22

33
[![npm (scoped)](https://img.shields.io/npm/v/@dadi/cdn.svg?maxAge=10800&style=flat-square)](https://www.npmjs.com/package/@dadi/cdn)
4-
[![coverage](https://img.shields.io/badge/coverage-69%25-yellow.svg?style=flat-square)](https://github.com/dadi/cdn)
4+
[![coverage](https://img.shields.io/badge/coverage-68%25-yellow.svg?style=flat-square)](https://github.com/dadi/cdn)
55
[![Build Status](https://travis-ci.org/dadi/cdn.svg?branch=master)](https://travis-ci.org/dadi/cdn)
66
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/)
77

dadi/lib/handlers/image.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ ImageHandler.prototype.convert = function (stream, imageInfo) {
417417
if (quality > 70) params.compression = 'none'
418418
else if (quality > 50) params.compression = 'fast'
419419
else params.compression = 'high'
420+
421+
params.transparency = 'auto'
420422
}
421423

422424
// sharpening
@@ -425,8 +427,8 @@ ImageHandler.prototype.convert = function (stream, imageInfo) {
425427
} else if (quality >= 70) {
426428
if (/jpe?g/.exec(imageInfo.format) || /jpe?g/.exec(options.format)) {
427429
batch.sharpen(5)
428-
} else if (/png/.exec(imageInfo.format) || /png/.exec(options.format)) {
429-
batch.sharpen(5)
430+
// } else if (/png/.exec(imageInfo.format) || /png/.exec(options.format)) {
431+
// batch.sharpen(5)
430432
} else if (options.cropX && options.cropY) {
431433
batch.sharpen(5)
432434
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
1212
},
1313
"dependencies": {
14-
"@dadi/cache": "git+https://github.com/dadi/cache.git#33ebd693ce35e122a87202fffbd3767cd2a6aa8a",
14+
"@dadi/cache": "1.5.x",
1515
"@dadi/logger": "latest",
1616
"@dadi/status": "latest",
1717
"accept-language-parser": "^1.2.0",
@@ -75,7 +75,7 @@
7575
"redis": "^2.6.3",
7676
"should": "~11.1.0",
7777
"sinon": "~1.17.5",
78-
"standard": "*",
78+
"standard": "8.x.x",
7979
"supertest": "~2.0.0",
8080
"semantic-release": "^6.3.2"
8181
},

test/images/bermuda-title.png

6.95 KB
Loading

0 commit comments

Comments
 (0)