diff --git a/chertex.sh b/chertex.sh index 55f5ba8..768f980 100755 --- a/chertex.sh +++ b/chertex.sh @@ -186,15 +186,15 @@ if [ $# -eq 1 ]; then # rsync can't do that. We need to use a different tool. See e.g. # https://superuser.com/questions/260092/rsync-switch-to-only-compare-timestamps # copy only the "large" photos that have file modtimes more recent than the last time this operation was run - photoslastrun="$path_wd/assets/photos/.lowres/lastrun" + photoslastrun="$path_thesis/assets/photos/.lowres/lastrun" if [ ! -f "$photoslastrun" ]; then # if, for some reason, the lastrun file does not exist # copy over everything and then create the file - rsync -av "$path_wd/assets/photos/*" "$path_wd/assets/photos/.lowres/" --exclude "$path_wd/assets/photos/.lowres/" + rsync -av "$path_thesis/assets/photos/" "$path_thesis/assets/photos/.lowres/" --exclude ".lowres/" touch "$photoslastrun" fi # cd and use --parents arg to preserve directory structure in .lowres target - cd "$path_wd/assets/photos" + cd "$path_thesis/assets/photos" newphotos="$(find . -type f -cnewer $photoslastrun ! -path './.lowres/*')" if [ -n "$newphotos" ]; then for newphoto in $newphotos; do @@ -204,7 +204,7 @@ if [ $# -eq 1 ]; then # revert the effects of cd above. Redirect to null suppresses the output. cd - >/dev/null # in the low-res tree, find any photo larger than specific size (500kB) - largephotos="$(find $path_wd/assets/photos/.lowres/ -size +500k)" + largephotos="$(find $path_thesis/assets/photos/.lowres/ -size +500k)" for largephotofilename in $largephotos; do # for the next statement to work reliably, we should probably convert other formats to JPEG # detect file extension, and based on it, convert to jpg using mogrify