mirror of
https://github.com/talgo-cloud/talgo-libwebp.git
synced 2026-03-07 13:38:17 -08:00
Merge pull request #23 from unak/fix/lossless
Need to initialize not only lossless preset but also normal preset
This commit is contained in:
commit
810c283197
1 changed files with 3 additions and 0 deletions
|
|
@ -131,6 +131,9 @@ func ConfigPreset(preset Preset, quality float32) (*Config, error) {
|
|||
// compression) and 9 (slower, best compression).
|
||||
func ConfigLosslessPreset(level int) (*Config, error) {
|
||||
c := &Config{}
|
||||
if C.WebPConfigPreset(&c.c, C.WebPPreset(PresetDefault), C.float(0)) == 0 {
|
||||
return nil, errors.New("failed to initialize webp config")
|
||||
}
|
||||
if C.webPConfigLosslessPreset(&c.c, C.int(level)) == 0 {
|
||||
return nil, errors.New("failed to initialize webp config")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue