From 35312768644730ae98e2a9a99b8d8fbd1e68ceff Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 26 Sep 2013 19:29:05 -0700 Subject: [PATCH] fix one part of #2024 --- include/mapnik/image_view.hpp | 5 ++--- include/mapnik/webp_io.hpp | 8 +++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/mapnik/image_view.hpp b/include/mapnik/image_view.hpp index b7bf54985..0f0e1be9e 100644 --- a/include/mapnik/image_view.hpp +++ b/include/mapnik/image_view.hpp @@ -89,11 +89,10 @@ public: return data_.getRow(row + y_) + x_; } - inline char const* getBytes() const + inline const unsigned char* getBytes() const { - return reinterpret_cast(&data_); + return data_.getBytes(); } - inline T& data() { return data_; diff --git a/include/mapnik/webp_io.hpp b/include/mapnik/webp_io.hpp index a697b39c9..3e0043770 100644 --- a/include/mapnik/webp_io.hpp +++ b/include/mapnik/webp_io.hpp @@ -116,17 +116,15 @@ void save_as_webp(T1& file, if (alpha) { int stride = sizeof(typename T2::pixel_type) * image.width(); - uint8_t const* bytes = reinterpret_cast(image.getBytes()); - ok = WebPPictureImportRGBA(&pic, bytes, stride); + ok = WebPPictureImportRGBA(&pic, image.getBytes(), stride); } else { 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); + ok = WebPPictureImportRGBX(&pic, image.getBytes(), stride); #else - ok = WebPPictureImportRGBA(&pic, bytes, stride); + ok = WebPPictureImportRGBA(&pic, image.getBytes(), stride); #endif }