node-image-steam icon indicating copy to clipboard operation
node-image-steam copied to clipboard

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

Open subtleGradient opened this issue 6 years ago • 2 comments

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 avatar Jul 16 '19 20:07 subtleGradient

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

subtleGradient avatar Jul 16 '19 20:07 subtleGradient

https://github.com/asilvas/node-image-steam/blob/fb47cc78869f4eba84abc825c56cac1b8c0b29b9/lib/router/router-defaults.js#L10

https://github.com/asilvas/node-image-steam/blob/fb47cc78869f4eba84abc825c56cac1b8c0b29b9/lib/processor/processor-defaults.js#L2

https://github.com/asilvas/node-image-steam/blob/fb47cc78869f4eba84abc825c56cac1b8c0b29b9/lib/processor/steps/resize.js#L27-L35

subtleGradient avatar Jul 16 '19 21:07 subtleGradient