eslint fixes
This commit is contained in:
parent
db6e643e99
commit
cf25fec275
@ -111,6 +111,7 @@ export default [
|
||||
"maxBOF": 0
|
||||
}],
|
||||
"no-whitespace-before-property": "error",
|
||||
"operator-linebreak": ["error", "after"],
|
||||
"space-in-parens": "error",
|
||||
"no-var": "error",
|
||||
"prefer-const": "error",
|
||||
|
||||
@ -280,9 +280,7 @@ class AddTextToImage extends Operation {
|
||||
}
|
||||
return imageBuffer.buffer;
|
||||
} catch (err) {
|
||||
throw new OperationError(`Error adding text to image. (${err})`, {
|
||||
cause: err,
|
||||
});
|
||||
throw new OperationError(`Error adding text to image. (${err})`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -56,9 +56,9 @@ class ExtractRGBA extends Operation {
|
||||
parsedImage = await Jimp.read(input);
|
||||
|
||||
let bitmap = parsedImage.bitmap.data;
|
||||
bitmap = includeAlpha
|
||||
? bitmap
|
||||
: bitmap.filter((val, idx) => idx % 4 !== 3);
|
||||
bitmap = includeAlpha ?
|
||||
bitmap :
|
||||
bitmap.filter((val, idx) => idx % 4 !== 3);
|
||||
|
||||
return bitmap.join(delimiter);
|
||||
}
|
||||
|
||||
@ -153,17 +153,17 @@ class SharpenImage extends Operation {
|
||||
// Only change pixel value if the difference is higher than threshold
|
||||
if ((luminanceDiff / 255) * 100 >= threshold) {
|
||||
this.bitmap.data[idx] =
|
||||
normalRed + maskRed <= 255
|
||||
? normalRed + maskRed
|
||||
: 255;
|
||||
normalRed + maskRed <= 255 ?
|
||||
normalRed + maskRed :
|
||||
255;
|
||||
this.bitmap.data[idx + 1] =
|
||||
normalGreen + maskGreen <= 255
|
||||
? normalGreen + maskGreen
|
||||
: 255;
|
||||
normalGreen + maskGreen <= 255 ?
|
||||
normalGreen + maskGreen :
|
||||
255;
|
||||
this.bitmap.data[idx + 2] =
|
||||
normalBlue + maskBlue <= 255
|
||||
? normalBlue + maskBlue
|
||||
: 255;
|
||||
normalBlue + maskBlue <= 255 ?
|
||||
normalBlue + maskBlue :
|
||||
255;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user