diff --git a/include/mapnik/webp_io.hpp b/include/mapnik/webp_io.hpp index 6cde7243e..28924acc8 100644 --- a/include/mapnik/webp_io.hpp +++ b/include/mapnik/webp_io.hpp @@ -83,7 +83,7 @@ void save_as_webp(T1& file, // Add additional tuning if (method >= 0) config.method = method; - #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 2 + #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 config.lossless = !!lossless; config.image_hint = static_cast(image_hint); #else @@ -106,7 +106,7 @@ void save_as_webp(T1& file, } pic.width = image.width(); pic.height = image.height(); - #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 2 + #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 pic.use_argb = !!lossless; #endif int ok = 0; @@ -120,7 +120,11 @@ void save_as_webp(T1& file, { int stride = sizeof(typename T2::pixel_type) * image.width(); uint8_t const* bytes = reinterpret_cast(image.getBytes()); + #if (WEBP_ENCODER_ABI_VERSION >> 8) >= 1 ok = WebPPictureImportRGBX(&pic, bytes, stride); + #else + ok = WebPPictureImportRGBA(&pic, bytes, stride); + #endif } if (!ok)