mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
examples: ignore loading raw image file.
in the last commit, it added a raw image file in the images folder. It breaks Multicanvas, Svg which try to load all kinds of files in it. We don't need to load all files by figuring out file extension name.
This commit is contained in:
parent
e00f948705
commit
b125a7ea2e
2 changed files with 9 additions and 1 deletions
|
@ -84,6 +84,10 @@ void drawSwView(void* data, Eo* obj)
|
|||
|
||||
void tvgSwTest(const char* name, const char* path, void* data)
|
||||
{
|
||||
//ignore if not svgs.
|
||||
const char *ext = name + strlen(name) - 3;
|
||||
if (strcmp(ext, "svg")) return;
|
||||
|
||||
Eo* win = (Eo*) data;
|
||||
|
||||
uint32_t* buffer = (uint32_t*) calloc(sizeof(uint32_t), SIZE * SIZE);
|
||||
|
|
|
@ -14,6 +14,10 @@ static std::vector<unique_ptr<tvg::Picture>> pictures;
|
|||
|
||||
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];
|
||||
|
|
Loading…
Add table
Reference in a new issue