From 42d3bb11afe1233ec0c4bba4328504ae0e42d6d7 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 15 Aug 2013 15:15:07 -0400 Subject: [PATCH] webp: WebPConfig.lossless, WebPPicture.use_argb, and WebPPictureImportRGBX all became available in libwebp v0.1.99 or ABI v1 - refs #1986 --- include/mapnik/webp_io.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)