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

allow custom filenaming #32

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

FoamyGuy
Copy link
Contributor

This change allows you to pass a custom string to get used instead of the default "img" in the photo filenames.

It will still include the 4 digit integer counter for ensuring unique names.

resolves #17

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

Thank you! However, I have a quibble

Comment on lines 830 to 833
filename = "/sd/img%04d.%s" % (self._image_counter, extension)
filename = f"/sd/{filename_prefix}%04d.%s" % (
self._image_counter,
extension,
)
Copy link
Member

Choose a reason for hiding this comment

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

I'd like you to revise this so that it's just one formatting operation. It'd be something like f"/sd/{filename_prefix}{image_counter:04d}.{extension}", I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The latest commits change that to use a single format operation. It turns out my IDEs code formatter also unintentionally broke the example by splitting a long line string across multiples so I fixed that with .format()

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.

Add custom file name to capture_jpeg()
2 participants