Skip to content

Commit ad3f4ca

Browse files
committed
let quality be a formats implementation detail, not something converted by lib
1 parent e551ae6 commit ad3f4ca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

formats-node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { PNG } = require('pngjs');
33

44
module.exports = {};
55

6-
module.exports.JPEG = ({ data, width, height, quality }) => jpegJs.encode({ data, width, height }, quality).data;
6+
module.exports.JPEG = ({ data, width, height, quality }) => jpegJs.encode({ data, width, height }, Math.floor(quality * 100)).data;
77

88
module.exports.PNG = ({ data, width, height }) => {
99
const png = new PNG({ width, height });

lib.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = (decode, encode) => {
44
width: image.width,
55
height: image.height,
66
data: image.data,
7-
quality: Math.floor(quality * 100)
7+
quality
88
});
99
};
1010

0 commit comments

Comments
 (0)