examples: ignoring pictures other than svgs in Stress.cpp
authorMira Grudzinska <m.grudzinska@samsung.com>
Tue, 13 Apr 2021 11:12:53 +0000 (13:12 +0200)
committerHermet Park <chuneon.park@samsung.com>
Mon, 19 Apr 2021 01:44:21 +0000 (10:44 +0900)
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

index 862b6af..9085731 100644 (file)
@@ -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];