rosell-dk / webp-convert

Convert jpeg/png to webp with PHP (if at all possible)
MIT License
578 stars 102 forks source link

Introduce "auto-limit" option instead of setting "quality" to "auto" #281

Closed rosell-dk closed 3 years ago

rosell-dk commented 3 years ago

Current state of affairs: quality: Can be a number (0-100) or "auto". max-quality: Only relevant when "quality" is set to "auto". default-quality: To be used when quality detection isn't working

Proposed state of affairs: quality: A number (0-100) auto-limit: Boolean. If set, and quality detection is working, quality will be limited so it does not exceed that of the jpeg.

Pros:

Cons:

It should made such that the old options still work, but the library informs that they are deprecated.

rosell-dk commented 3 years ago

Mapping from old options to new options: quality: "auto", max-quality: 85, default-quality: 75 becomes: quality: 85, auto-limit: true

quality: 80 becomes: quality: 80, auto-limit: false