mirror of
https://github.com/talgo-cloud/talgo-libwebp.git
synced 2026-03-08 23:18:13 -07:00
Add support for libwebp version 4.
This commit is contained in:
parent
6608fdcc01
commit
bbce08acb6
1 changed files with 9 additions and 1 deletions
|
|
@ -14,6 +14,14 @@ static void free_WebPPicture(WebPPicture* webpPicture) {
|
||||||
free(webpPicture);
|
free(webpPicture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int webPConfigLosslessPreset(WebPConfig* webpConfig, int level) {
|
||||||
|
#if WEBP_ENCODER_ABI_VERSION < 0x203
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
return WebPConfigLosslessPreset(webpConfig, level);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static int getNearLossless(WebPConfig* webpConfig, int* value) {
|
static int getNearLossless(WebPConfig* webpConfig, int* value) {
|
||||||
#if WEBP_ENCODER_ABI_VERSION < 0x206
|
#if WEBP_ENCODER_ABI_VERSION < 0x206
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -82,7 +90,7 @@ func ConfigPreset(preset Preset, quality float32) (*Config, error) {
|
||||||
// compression) and 9 (slower, best compression).
|
// compression) and 9 (slower, best compression).
|
||||||
func ConfigLosslessPreset(level int) (*Config, error) {
|
func ConfigLosslessPreset(level int) (*Config, error) {
|
||||||
c := &Config{}
|
c := &Config{}
|
||||||
if C.WebPConfigLosslessPreset(&c.c, C.int(level)) == 0 {
|
if C.webPConfigLosslessPreset(&c.c, C.int(level)) == 0 {
|
||||||
return nil, errors.New("failed to initialize webp config")
|
return nil, errors.New("failed to initialize webp config")
|
||||||
}
|
}
|
||||||
return c, nil
|
return c, nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue