-
Notifications
You must be signed in to change notification settings - Fork 5
Description
i'd like the old flavor of crgen, the image crop which just based on the px, not resize the original image
so i did a patch for current version
const transformSplash = (definition) => {
const image = imageObj.splash;
const { width } = definition;
const { height } = definition;
const outputFilePath = path.join(platformPath, definition.name);
const outDir = path.dirname(outputFilePath);
return fs.ensureDir(outDir).then(() => image
.extract({left: parseInt((image.meta.width - width) / 2), top: parseInt((image.meta.height - height) / 2) , width, height})
.toFile(outputFilePath));
};``
.extract({left: parseInt((image.meta.width - width) / 2), top: parseInt((image.meta.height - height) / 2) , width, height})
instead of
.crop(sharp.strategy.entropy)
can you give a build-in command line switch for this
like
irgen --extract
or something else
please ^ ^