-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crop behavior request #86
Comments
@sebinbenjamin |
Sure. Please get me a screenshot/image of the expected behavior, to make sure I understand you correctly. |
|
my bad... i installed from npm version 0.62, it seems an old deprecated version, now it works perfectly! |
I'm working on a solution, although you should try to use a proper splash base to start with. Ideally, the splash screen's artwork should roughly fit/cover a square (1200×1200px out of 2732x2732px) at the centre of the image. You can use this template provided by the Ionic team. Make sure that the logo fits in the orange square at the centre. A minimum content size covering at least half of the orange square makes sure that the output splash does not lose much detail. |
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 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 ^ ^
The text was updated successfully, but these errors were encountered: