File: webp_io.cpp

package info (click to toggle)
mapnik 4.2.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,592 kB
  • sloc: cpp: 163,859; python: 1,332; sh: 690; xml: 161; makefile: 123; perl: 28; lisp: 13
file content (27 lines) | stat: -rw-r--r-- 547 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

#if defined(HAVE_WEBP)

#include "catch.hpp"

#include <sstream>

#include <mapnik/image_view.hpp>
#include <mapnik/webp_io.hpp>

TEST_CASE("webp io")
{
    SECTION("does not crash accessing view")
    {
        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);
    }
}

#endif