summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-04-12 20:55:22 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-04-12 20:56:48 +0900
commit3d6fa02540e8b56f85d285309268db5c6d793636 (patch)
tree17bf370acb4813ac45421a69acc0d2f20449c485
parent4c3646123330086dd6d7508d68b6739826407929 (diff)
evas - loading extension query - fix to not skip small extensions
since this can take an extension as well as a file path (extension being .gif or .jpeg etc.) it would skip if passed a small extension only (5 chars or less). fix and this fixes e's thumbnailing too for some files. @fix
-rw-r--r--src/lib/evas/common/evas_image_load.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/evas/common/evas_image_load.c b/src/lib/evas/common/evas_image_load.c
index 0ea6a582d6..d1ffed88c6 100644
--- a/src/lib/evas/common/evas_image_load.c
+++ b/src/lib/evas/common/evas_image_load.c
@@ -516,14 +516,17 @@ evas_common_extension_can_load_get(const char *file)
516 unsigned int i; 516 unsigned int i;
517 517
518 length = eina_stringshare_strlen(file) + 1; 518 length = eina_stringshare_strlen(file) + 1;
519 if (length < 5) return EINA_FALSE;
520 519
521 for (i = 0; i < sizeof (loaders) / sizeof (struct ext_loader_s); ++i) 520 for (i = 0; i < sizeof (loaders) / sizeof (struct ext_loader_s); ++i)
522 { 521 {
523 if (loaders[i].length > length) continue; 522 if (loaders[i].length > length) continue;
524 523
525 if (!strcasecmp(loaders[i].extension, file + length - loaders[i].length)) 524 if (!strcasecmp(loaders[i].extension, file + length - loaders[i].length))
526 return EINA_TRUE; 525 {
526 if ((file[length - loaders[i].length] != '/') ||
527 (length == loaders[i].length))
528 return EINA_TRUE;
529 }
527 } 530 }
528 return EINA_FALSE; 531 return EINA_FALSE;
529} 532}