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

Add function to save a thumbnail #632

Merged
merged 2 commits into from
Jun 18, 2024
Merged

Conversation

DominicOram
Copy link
Contributor

Fixes #628

Note that this will only be needed for a month or so, no need to review too heavily.

Instructions to reviewer on how to test:

  1. Confirm new test passes

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@@ -49,6 +50,9 @@ def _save_image(self, image: Image.Image):

LOGGER.info(f"Saving image to {path}")
image.save(path)

save_thumbnail(Path(path), image)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PIL documentation states that this modifies the image, but looks like we are ok in all our usages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yh, I thought about doing the copy but didn't seem worth it as we're always calling after saving the original. Thanks for checking though.

Copy link
Contributor

@rtuck99 rtuck99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@DominicOram DominicOram merged commit 5ff36da into main Jun 18, 2024
11 checks passed
@DominicOram DominicOram deleted the 628_thumbnail_on_snapshots branch June 18, 2024 16:33
rtuck99 added a commit to DiamondLightSource/hyperion that referenced this pull request Jul 16, 2024
rtuck99 added a commit to DiamondLightSource/hyperion that referenced this pull request Jul 16, 2024
rtuck99 added a commit to DiamondLightSource/hyperion that referenced this pull request Jul 17, 2024
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.

Save thumbnail images for snapshots
2 participants