Change name of images recorded by the Camera
Block
#104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As reported in #98, the name of the images saved by the
Camera
Block (via theImageSaver
CameraProcess
) is currently in the formatf'{index}_{time:.3f}.{ext}'
. Example image names:1_0.100
,2_0.200
,21_2.100
, etc. This poses problems for navigating in file explorers, or for compatibility with third -party processing software, as the first character in the name is used for sorting.This PR changes the name of the recorded images to
f'{index:06d}_{time:.3f}.{ext}'
, therefore adding a zero-padding as a prefix to the index to get at least 6 digits. The example names become000001_0.100
,000002_0.200
,000021_2.100
, etc. This PR fixes the sorting issue with file explorers and third-party software when less than 1 millions images are acquired. It preserves compatibility with theFileReader
Camera without requiring changes in this file.