From 91c315aee77aaa5bd97a045d25c847d0db9b8aa1 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Wed, 7 Sep 2011 20:01:01 +0000 Subject: [PATCH] applied patch from kkaefer (gist: 9e0d59a418f8ca653d26) --- src/image_util.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/image_util.cpp b/src/image_util.cpp index 291ae5beb..dc1fbbebe 100644 --- a/src/image_util.cpp +++ b/src/image_util.cpp @@ -86,6 +86,15 @@ std::string save_to_string(T const& image, return ss.str(); } +template +std::string save_to_string(T const& image, + std::string const& type) +{ + std::ostringstream ss(std::ios::out|std::ios::binary); + save_to_stream(image, ss, type); + return ss.str(); +} + template void save_to_file(T const& image, std::string const& filename, @@ -428,6 +437,9 @@ template void save_to_file(image_data_32 const&, std::string const&, rgba_palette const& palette); +template std::string save_to_string(image_data_32 const&, + std::string const&); + template std::string save_to_string(image_data_32 const&, std::string const&, rgba_palette const& palette); @@ -448,6 +460,9 @@ template void save_to_file > (image_view > (image_view const&, + std::string const&); + template std::string save_to_string > (image_view const&, std::string const&, rgba_palette const& palette);