Skip to content
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

Feature request: optionally cap the max pixel count instead of max dimensions #78

Open
subtleGradient opened this issue Jul 16, 2019 · 2 comments

Comments

@subtleGradient
Copy link

Use case: we have a bunch of super tall and skinny images.
Since they're so tall, they're hitting the originalSteps maximum height limit.
But since they're so skinny, they shouldn't be unnecessarily scaled down.

So, I propose calculating a maximum pixel count instead of maximum dimensions.

@subtleGradient
Copy link
Author

I'm planning to implement this myself (if I can figure out how ;)

@subtleGradient
Copy link
Author

resize: { width: '2560', height: '2560', max: 'true', canGrow: 'false' },

maxSize: { width: 2560, height: 2560 }

if (context.options.maxSize) {
// request should never exceed permitted output size
if (stepInfo.width > context.options.maxSize.width) {
stepInfo.width = context.options.maxSize.width;
}
if (stepInfo.height > context.options.maxSize.height) {
stepInfo.height = context.options.maxSize.height;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants