From bec160da93cac292e30c4afdea986816b6db6867 Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Tue, 13 Apr 2021 13:12:53 +0200 Subject: [PATCH] examples: ignoring pictures other than svgs in Stress.cpp The picture->size() function does not work for raw/png pictures. As a consequence enabling both, the svg and png file loaders, resulted in the unintended behavior of the example. --- src/examples/Stress.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/examples/Stress.cpp b/src/examples/Stress.cpp index 862b6af..9085731 100644 --- a/src/examples/Stress.cpp +++ b/src/examples/Stress.cpp @@ -38,6 +38,10 @@ static double t1, t2, t3, t4; void svgDirCallback(const char* name, const char* path, void* data) { + //ignore if not svgs. + const char *ext = name + strlen(name) - 3; + if (strcmp(ext, "svg")) return; + auto picture = tvg::Picture::gen(); char buf[PATH_MAX]; -- 2.7.4