summaryrefslogtreecommitdiff
path: root/legacy/ethumb
diff options
context:
space:
mode:
authorRafael Antognolli <antognolli@gmail.com>2009-11-06 22:17:55 +0000
committerRafael Antognolli <antognolli@gmail.com>2009-11-06 22:17:55 +0000
commit755a5f7da67e0f1b1e15f1c4d36338f1a0ac916a (patch)
tree84e4a9623442f8e1baae125f4dad41d0190ef95d /legacy/ethumb
parent6310f0ef55928d0238b2dc9267f0bc4d97e366b2 (diff)
Make ethumb match case-insensitive.
Ethumb wasn't matching files to plugins if the extension were not composed of all lowercase chars. This patch makes the ethumb match case-insensitive. Patch by: João Paulo Rechi Vita SVN revision: 43502
Diffstat (limited to 'legacy/ethumb')
-rw-r--r--legacy/ethumb/src/lib/Ethumb.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/legacy/ethumb/src/lib/Ethumb.c b/legacy/ethumb/src/lib/Ethumb.c
index bb93c34ced..3582b1f083 100644
--- a/legacy/ethumb/src/lib/Ethumb.c
+++ b/legacy/ethumb/src/lib/Ethumb.c
@@ -51,6 +51,7 @@ void *alloca (size_t);
51#include <sys/stat.h> 51#include <sys/stat.h>
52#include <dirent.h> 52#include <dirent.h>
53#include <dlfcn.h> 53#include <dlfcn.h>
54#include <ctype.h>
54 55
55#ifndef PATH_MAX 56#ifndef PATH_MAX
56# define PATH_MAX 4096 57# define PATH_MAX 4096
@@ -1060,20 +1061,26 @@ ethumb_calculate_fill(Ethumb *e, int iw, int ih, int *fx, int *fy, int *fw, int
1060static Eina_Bool 1061static Eina_Bool
1061_ethumb_plugin_generate(Ethumb *e) 1062_ethumb_plugin_generate(Ethumb *e)
1062{ 1063{
1063 const char *ext; 1064 const char *extp;
1065 char ext[PATH_MAX];
1064 Ethumb_Plugin *plugin; 1066 Ethumb_Plugin *plugin;
1067 int i;
1065 1068
1066 ext = strrchr(e->src_path, '.'); 1069 extp = strrchr(e->src_path, '.');
1067 if (!ext) 1070 if (!extp)
1068 { 1071 {
1069 ERR("could not get extension for file \"%s\"", e->src_path); 1072 ERR("could not get extension for file \"%s\"", e->src_path);
1070 return EINA_FALSE; 1073 return EINA_FALSE;
1071 } 1074 }
1072 1075
1073 plugin = eina_hash_find(_plugins_ext, ext + 1); 1076 for (i = 0; extp[i] != '\0'; i++)
1077 ext[i] = tolower(extp[i + 1]);
1078
1079 plugin = eina_hash_find(_plugins_ext, ext);
1074 if (!plugin) 1080 if (!plugin)
1075 { 1081 {
1076 DBG("no plugin for extension: \"%s\"", ext + 1); 1082 DBG("no plugin for extension: \"%s\"", ext);
1083 free(ext);
1077 return EINA_FALSE; 1084 return EINA_FALSE;
1078 } 1085 }
1079 1086
@@ -1151,7 +1158,8 @@ ethumb_image_save(Ethumb *e)
1151 1158
1152 if (!r) 1159 if (!r)
1153 { 1160 {
1154 ERR("could not save image."); 1161 ERR("could not save image: path=%s, key=%s", e->thumb_path,
1162 e->thumb_key);
1155 return EINA_FALSE; 1163 return EINA_FALSE;
1156 } 1164 }
1157 1165