Skip to content

Commit

Permalink
testing different versions
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Feb 1, 2019
1 parent ef2ff7d commit 1af19f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rvm:
- ruby-head
- jruby-head
env:
- LIBWEBP_VERSION=0.4.0
- LIBWEBP_VERSION=0.4.4
- LIBWEBP_VERSION=1.0.2

cache: bundler
Expand Down
6 changes: 5 additions & 1 deletion ext/webp_ffi/webp_ffi.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ int webp_encode(const char *in_file, const char *out_file, const FfiWebpEncodeCo
if (encode_config->lossless == 0 || encode_config->lossless == 1){
config.lossless = encode_config->lossless;
}
if (WebPGetEncoderVersion() >= 0x010000 && encode_config->near_lossless >= 0 && encode_config->near_lossless <= 100){

#ifdef __cplusplus
if (encode_config->near_lossless >= 0 && encode_config->near_lossless <= 100){
config.near_lossless = encode_config->near_lossless;
config.lossless = 1; // use near-lossless only with lossless
}
#endif

if (encode_config->quality >= 0 && encode_config->quality <= 100){
config.quality = encode_config->quality;
}
Expand Down

0 comments on commit 1af19f2

Please sign in to comment.