Skip to content

Commit

Permalink
Merge pull request #627 from thomasjacquin/copy_notification_image.sh…
Browse files Browse the repository at this point in the history
…-wrong-directory

copy_notification_image.sh wrong directory 50%
  • Loading branch information
linuxkidd authored Oct 10, 2021
2 parents 31824dd + 14374a6 commit c6b3518
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/copy_notification_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ fi
# If at nighttime, save them in (possibly) yesterday's directory.
# If during day, save in today's directory.
if [ "${DAYTIME_SAVE}" = "true" -o "${CAPTURE_24HR}" = "true" ] ; then
IMAGES_DIR="${ALLSKY_IMAGES}/$(date +'%Y%m%d')"
THUMB="${IMAGES_DIR}/thumbnails/${FILENAME}-$(date +'%Y%m%d%H%M%S').${EXTENSION}"
DATE_DIR="${ALLSKY_IMAGES}/$(date +'%Y%m%d')"
# Use today's folder if it exists, otherwise yesterday's
[ ! -d "${DATE_DIR}" ] && DATE_DIR="${ALLSKY_IMAGES}/$(date -d '12 hours ago' +'%Y%m%d')"
THUMB="${DATE_DIR}/thumbnails/${FILENAME}-$(date +'%Y%m%d%H%M%S').${EXTENSION}"

convert "${IMAGE_TO_USE}" -resize "${THUMBNAIL_SIZE_X}x${THUMBNAIL_SIZE_Y}" "${THUMB}"
if [ $? -ne 0 ] ; then
Expand Down

0 comments on commit c6b3518

Please sign in to comment.