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

darkCapture.sh: bug fix #1017

Merged
merged 1 commit into from
Feb 12, 2022
Merged

darkCapture.sh: bug fix #1017

merged 1 commit into from
Feb 12, 2022

Conversation

EricClaeys
Copy link
Collaborator

Move the dark file to the darks directory rather than copy it.
If the user isn't using notification images, copy the file back to tmp/image.jpg so the websites can see it.

Move the dark file to the darks directory rather than copy it.
If the user isn't using notification images, copy the file back to tmp/image.jpg so the websites can see it.
@AndreasLMeg
Copy link
Collaborator

I try to test this...

@AndreasLMeg
Copy link
Collaborator

before:

18:10:41 ======================================================================
18:10:41 TEST: s ./test_saveImage_darks_notificationimages.sh: 
18:10:41 TEST: i Testcase: saveImage.sh NIGHT /home/pi/allsky/tmp/dark.jpg (RESIZE+CROP+AUTO_STRECH+RESIZE_UPLOADS)
18:10:41 TEST: i SETUP
18:10:41 TEST: i /home/pi/allsky/config/config.sh: IMG_RESIZE=true
18:10:42 TEST: i /home/pi/allsky/config/config.sh: IMG_WIDTH=2028
18:10:42 TEST: i /home/pi/allsky/config/config.sh: IMG_HEIGHT=1520
18:10:42 TEST: i /home/pi/allsky/config/config.sh: CROP_IMAGE=true
18:10:42 TEST: i /home/pi/allsky/config/config.sh: CROP_WIDTH=640
18:10:42 TEST: i /home/pi/allsky/config/config.sh: CROP_HEIGHT=480
18:10:42 TEST: i /home/pi/allsky/config/config.sh: CROP_OFFSET_X=0
18:10:42 TEST: i /home/pi/allsky/config/config.sh: CROP_OFFSET_Y=0
18:10:43 TEST: i /home/pi/allsky/config/config.sh: AUTO_STRETCH=true
18:10:43 TEST: i /home/pi/allsky/config/config.sh: AUTO_STRETCH_AMOUNT=10
18:10:43 TEST: i /home/pi/allsky/config/config.sh: AUTO_STRETCH_MID_POINT=10%
18:10:43 TEST: i /home/pi/allsky/config/config.sh: IMG_CREATE_THUMBNAILS=true
18:10:43 TEST: i /home/pi/allsky/config/config.sh: IMG_UPLOAD=true
18:10:43 TEST: i /home/pi/allsky/config/config.sh: RESIZE_UPLOADS=true
18:10:43 TEST: i /home/pi/allsky/config/config.sh: RESIZE_UPLOADS_SIZE=962x720
18:10:43 TEST: i /home/pi/allsky/config/config.sh: DARK_FRAME_SUBTRACTION=true
18:10:43 TEST: i /home/pi/allsky/config/settings_RPiHQ.json: darkframe=1
18:10:43 TEST: i /home/pi/allsky/config/settings_RPiHQ.json: notificationimages=1
18:10:43 TEST: i EXECUTION
18:10:43 MOCK: > /home/pi/allsky/scripts/saveImage.sh: NIGHT /home/pi/allsky/tmp/dark.jpg
18:10:45 TEST: i EVALUATION
18:10:45 TEST: i /home/pi/allsky/darks exists OK
18:10:45 TEST: i /home/pi/allsky/darks/dark.jpg darkframe exists OK
18:10:45 TEST: i /home/pi/allsky/darks/dark.jpg darkframe -> image should not change (identify) OK
18:10:45 TEST: i /home/pi/allsky/images/20220212/dark.jpg darkframe -> should not exists in date-dir OK
18:10:45 TEST: i /home/pi/allsky/images/20220212/thumbnails/dark.jpg darkframe -> should not exists in date-dir/thumbnails OK
18:10:45 TEST: e /home/pi/allsky/tmp/dark.jpg removed by script FAIL (1 != 0)
18:10:45 TEST: i /home/pi/allsky/tmp/resize-dark.jpg darkframe -> not to resize and upload OK
18:10:45 TEST: i /home/pi/allsky/tmp/image.jpg exists OK
18:10:45 TEST: i /home/pi/allsky/tmp/image.jpg  notificationimages=1, dont show darkframe (identify) OK
18:10:45 TEST: i TEARDOWN
18:10:45 TEST: i ERR_CNT=1
18:10:45 ======================================================================

after:

18:25:31 ======================================================================
18:25:31 TEST: s ./test_saveImage_darks_notificationimages.sh: 
18:25:31 TEST: i Testcase: saveImage.sh NIGHT /home/pi/allsky/tmp/dark.jpg (RESIZE+CROP+AUTO_STRECH+RESIZE_UPLOADS)
18:25:31 TEST: i SETUP
18:25:31 TEST: i /home/pi/allsky/config/config.sh: IMG_RESIZE=true
18:25:31 TEST: i /home/pi/allsky/config/config.sh: IMG_WIDTH=2028
18:25:31 TEST: i /home/pi/allsky/config/config.sh: IMG_HEIGHT=1520
18:25:31 TEST: i /home/pi/allsky/config/config.sh: CROP_IMAGE=true
18:25:31 TEST: i /home/pi/allsky/config/config.sh: CROP_WIDTH=640
18:25:31 TEST: i /home/pi/allsky/config/config.sh: CROP_HEIGHT=480
18:25:31 TEST: i /home/pi/allsky/config/config.sh: CROP_OFFSET_X=0
18:25:31 TEST: i /home/pi/allsky/config/config.sh: CROP_OFFSET_Y=0
18:25:32 TEST: i /home/pi/allsky/config/config.sh: AUTO_STRETCH=true
18:25:32 TEST: i /home/pi/allsky/config/config.sh: AUTO_STRETCH_AMOUNT=10
18:25:32 TEST: i /home/pi/allsky/config/config.sh: AUTO_STRETCH_MID_POINT=10%
18:25:32 TEST: i /home/pi/allsky/config/config.sh: IMG_CREATE_THUMBNAILS=true
18:25:32 TEST: i /home/pi/allsky/config/config.sh: IMG_UPLOAD=true
18:25:32 TEST: i /home/pi/allsky/config/config.sh: RESIZE_UPLOADS=true
18:25:32 TEST: i /home/pi/allsky/config/config.sh: RESIZE_UPLOADS_SIZE=962x720
18:25:32 TEST: i /home/pi/allsky/config/config.sh: DARK_FRAME_SUBTRACTION=true
18:25:32 TEST: i /home/pi/allsky/config/settings_RPiHQ.json: darkframe=1
18:25:32 TEST: i /home/pi/allsky/config/settings_RPiHQ.json: notificationimages=1
18:25:32 TEST: i EXECUTION
18:25:32 MOCK: > /home/pi/allsky/scripts/saveImage.sh: NIGHT /home/pi/allsky/tmp/dark.jpg
18:25:33 TEST: i EVALUATION
18:25:33 TEST: i /home/pi/allsky/darks exists OK
18:25:33 TEST: i /home/pi/allsky/darks/dark.jpg darkframe exists OK
18:25:33 TEST: i /home/pi/allsky/darks/dark.jpg darkframe -> image should not change (identify) OK
18:25:33 TEST: i /home/pi/allsky/images/20220212/dark.jpg darkframe -> should not exists in date-dir OK
18:25:33 TEST: i /home/pi/allsky/images/20220212/thumbnails/dark.jpg darkframe -> should not exists in date-dir/thumbnails OK
18:25:33 TEST: i /home/pi/allsky/tmp/dark.jpg removed by script OK
18:25:33 TEST: i /home/pi/allsky/tmp/resize-dark.jpg darkframe -> not to resize and upload OK
18:25:33 TEST: i /home/pi/allsky/tmp/image.jpg exists OK
18:25:33 TEST: i /home/pi/allsky/tmp/image.jpg  notificationimages=1, dont show darkframe (identify) OK
18:25:33 TEST: i TEARDOWN
18:25:34 TEST: i ERR_CNT=0
18:25:34 ======================================================================

@linuxkidd linuxkidd merged commit f8a9b23 into master Feb 12, 2022
@AndreasLMeg
Copy link
Collaborator

AndreasLMeg commented Feb 12, 2022

@EricClaeys
End of darkCapture execution: Is this OK to copy the dark file into /home/pi/allsky/ ?
I think ${CAPTURE_SAVE_DIR}/${FULL_FILENAME} should be used.

++ MOVE_TO_FILE=/home/pi/allsky/darks/dark.jpg
++ mv /home/pi/allsky/tmp/dark.jpg /home/pi/allsky/darks/dark.jpg
+++ jq -r .notificationimages /home/pi/allsky/config/settings_RPiHQ.json
++ USE_NOTIFICATION_IMAGES=0
++ '[' 0 = 0 ']'
++ cp /home/pi/allsky/darks/dark.jpg image.jpg
++ exit 0

@linuxkidd : sorry, my testing is too slow...

@EricClaeys
Copy link
Collaborator Author

@AndreasLMeg You are correct. I'll do a new PR to fix.

@EricClaeys EricClaeys deleted the darkCapture.sh-bug-fix branch February 12, 2022 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants