2015-05-22 03:39:14 +00:00
|
|
|
|
2015-05-22 03:42:18 +00:00
|
|
|
#if defined(HAVE_WEBP)
|
2015-05-22 03:39:14 +00:00
|
|
|
|
|
|
|
#include "catch.hpp"
|
|
|
|
|
2021-10-09 11:46:24 +00:00
|
|
|
#include <sstream>
|
|
|
|
|
2015-10-29 15:35:45 +00:00
|
|
|
#include <mapnik/image_view.hpp>
|
2015-05-22 03:39:14 +00:00
|
|
|
#include <mapnik/webp_io.hpp>
|
|
|
|
|
2022-01-26 22:25:53 +00:00
|
|
|
TEST_CASE("webp io")
|
|
|
|
{
|
|
|
|
SECTION("does not crash accessing view")
|
2015-05-22 03:39:14 +00:00
|
|
|
{
|
2022-01-26 22:25:53 +00:00
|
|
|
std::stringstream s;
|
|
|
|
mapnik::image_rgba8 im(1024, 1024);
|
|
|
|
mapnik::image_view_rgba8 view(512, 512, 1024, 1024, im);
|
|
|
|
WebPConfig config;
|
|
|
|
if (!WebPConfigInit(&config))
|
|
|
|
{
|
|
|
|
throw std::runtime_error("version mismatch");
|
|
|
|
}
|
|
|
|
save_as_webp(s, view, config, true);
|
2015-05-22 03:39:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|