imagemin / imagemin-webp

WebP plugin for imagemin
MIT License
494 stars 45 forks source link

Resize using only one property #43

Open busybox11 opened 2 years ago

busybox11 commented 2 years ago

Hi, I'm trying to use this webpack module to resize images using a defined height. Though all of these images don't have the same width and I'd like to keep the original aspect ratio. I searched in the docs if that was possible but it seems not. Giving a single property to the resize object (for example, width), errors out saying that the other one is undefined. Maybe I am mistaken but if that's not the case, could it be possible to integrate an option like this? Thanks in advance!

mobiliabrus commented 2 years ago

set 0 for auto.

resize: { width: 100, height: 0 }
resize: { width: 0, height: 100 }
busybox11 commented 2 years ago

Thank you! This should definitely be added to the README. Going to test this out soon, thanks for your help!