Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added scaling option to save disk space #297

Merged
merged 3 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config.sh.repo
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ DAYTIME="1"
# Set 24Hr capture to true to save both night and day images to disk. By default, only night images are saved.
CAPTURE_24HR=false

# Resize images before cropping and saving
IMG_RESIZE=true
IMG_HEIGHT=1520
IMG_WIDTH=2028

# Crop the captured image, used to improve the images when using a fisheye lens
CROP_IMAGE=false
CROP_WIDTH=640
Expand Down
5 changes: 5 additions & 0 deletions scripts/saveImageDay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ fi

IMAGE_TO_USE="$FULL_FILENAME"

# Resize the image if required
if [[ $IMG_RESIZE == "true" ]]; then
convert "$IMAGE_TO_USE" -resize "$IMG_WIDTH"x"$IMG_HEIGHT" $IMAGE_TO_USE
fi

# Crop the image around the center if required
if [[ $CROP_IMAGE == "true" ]]; then
convert "$IMAGE_TO_USE" -gravity Center -crop "$CROP_WIDTH"x"$CROP_HEIGHT"+"$CROP_OFFSET_X"+"$CROP_OFFSET_Y" +repage "$IMAGE_TO_USE";
Expand Down
5 changes: 5 additions & 0 deletions scripts/saveImageNight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ if [ "$DARK_FRAME_SUBTRACTION" = true ] ; then
IMAGE_TO_USE="$FILENAME-processed.$EXTENSION"
fi

# Resize the image if required
if [[ $IMG_RESIZE == "true" ]]; then
convert "$IMAGE_TO_USE" -resize "$IMG_WIDTH"x"$IMG_HEIGHT" $IMAGE_TO_USE
fi

# Crop the image around the center if required
if [[ $CROP_IMAGE == "true" ]]; then
convert "$IMAGE_TO_USE" -gravity Center -crop "$CROP_WIDTH"x"$CROP_HEIGHT"+"$CROP_OFFSET_X"+"$CROP_OFFSET_Y" +repage "$IMAGE_TO_USE";
Expand Down