2 # Copyright 2014 - 2016 Paul Hänsch
4 # This file is part of Serve0
6 # Serve0 is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # Serve0 is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Affero General Public License for more details.
16 # You should have received a copy of the GNU Affero General Public License
17 # along with Serve0 If not, see <http://www.gnu.org/licenses/>.
20 genmeta="$dir/genmeta.sh"
21 genthumb="$dir/genthumb.sh"
22 . "$dir/../constants.sh"
28 length=0; width=0; height=0;
29 if [ -r "$meta" ]; then
30 head -n1 "$meta" |read length width height info
31 tags="$(sed -n 2p "$meta" |sed -r 's:^\|(.*)$:\1:')"
32 description="$(sed -n '3,$p' "$meta")"
35 egrep -q "(^|.*\|)$tag(\|.*|$)" <<<"$tags" || tags="$tag|$tags"
38 $length $width $height $info
46 if (egrep -q "$file_pattern" <<<"$each"); then
47 printf %s "$each ... Thumb ..."
48 $genthumb "$each" "${each}.jpg" >/dev/null 2>/dev/null
50 $genmeta "$each" "${each}.meta" >/dev/null 2>/dev/null
53 addtag "${each}.meta" "$tag"