Hi,
jevents creates thumbnails which works fine. But in case the original image is deleted the thumb stays. Is there some nice joomla or jevents way to get rid of those orphans? --- house cleaning. I would go with a cronjob bash, something like below, but would prefer to do it within joomla backend.
thanks,
toni
jevents creates thumbnails which works fine. But in case the original image is deleted the thumb stays. Is there some nice joomla or jevents way to get rid of those orphans? --- house cleaning. I would go with a cronjob bash, something like below, but would prefer to do it within joomla backend.
thanks,
toni
IFS=$'\n';
FULLMEDIAPATH="."
JEVENTSFOLDER="jevents"
# save all image names of media folder *except jevents* to array
array=( $(find "$FULLMEDIAPATH" -type f -name *.jpg -not -path "*/$JEVENTSFOLDER/*" | sed 's/.*\///') )
# loop through images of jevents and check if they exist in array of media array
for f in $(find "$FULLMEDIAPATH/$JEVENTSFOLDER" -name '*.jpg' -or -name '*.png'); do
if [[ ! " ${array[@]} " =~ `echo $f | sed 's/.*\///'i` ]]; then
echo "not found $f";
# rm $f;
fi
done
unset IFS;