Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4495701

Browse files
authored
fix: don’t force a color transform by default for CMYK images (jpeg-js#64)
* Fix: Don’t force a color transform by default The default opts overwrote the sane default of NOT transforming CMYK images unless there’s a transformCode set. The default of true rendered the `if`s in line 841 and 880 useless since `this.colorTransform` was always set. * Fix typo * Add test with patrickhulce’s example image BREAKING CHANGE: CMYK images will respect their embedded `transformCode`
1 parent 275c852 commit 4495701

File tree

4 files changed

+13157
-1
lines changed

4 files changed

+13157
-1
lines changed

lib/decoder.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,8 @@ module.exports = decode;
988988
function decode(jpegData, opts) {
989989
var defaultOpts = {
990990
useTArray: false,
991-
colorTransform: true,
991+
// "undefined" means "Choose whether to transform colors based on the image’s color model."
992+
colorTransform: undefined,
992993
formatAsRGBA: true
993994
};
994995
if (opts) {

0 commit comments

Comments
 (0)