diff s4-funcs.sh @ 339:47d83939666b

Add extension to icon cache file if it has no one
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 23 Oct 2016 23:31:46 +0859
parents 48d0b6c4de65
children a06cd57df83a
line wrap: on
line diff
--- a/s4-funcs.sh	Sun Oct 23 23:11:56 2016 +0859
+++ b/s4-funcs.sh	Sun Oct 23 23:31:46 2016 +0859
@@ -1535,6 +1535,12 @@
   valtype=`query "$sql0"`
   filename=${valtype%%//*}
   filetype=${valtype##*//file:}
+  if [ x"$filename" = x"${filename%.*}" ]; then
+    # If nor filename extension found, set it to image type
+    case "$filetype" in
+      image/*) filename=$filename.${filetype#image/} ;;
+    esac
+  fi
   cacheimg_S=$dir/S_$filename
   cacheimg_M=$dir/M_$filename
   cacheimg_O=$dir/$filename
@@ -1575,11 +1581,6 @@
 	VALUES($pval, '$iconcachekey', 'string', `sqlquote "$cacheimg_S"`);
 	EOF
 )
-imgsrc_cache_clear() {
-  # $1=table
-  # $2=keycond
-  query "DELETE FROM $1 WHERE $2 AND key='$iconcachekey';"
-}    
 
 showhome() {
   # $1=userRowIdToShow

yatex.org