napari / napari-animation

A napari plugin for making animations
https://napari.github.io/napari-animation/
Other
74 stars 27 forks source link

Improve image filename enumeration #139

Closed sassanostvar closed 1 year ago

sassanostvar commented 1 year ago

Hi All,

This is hardly critical, but it would be helpful to add more digits/leading zeros to enumerated output filenames. This would make it easier to preserve the right sequential order in downstream command-line applications like ImageMagick's convert.

One solution is to change line 218 in [https://github.com/napari/napari-animation/blob/main/napari_animation/animation.py]:

from

fname = folder_path / (
                    path_obj.stem + "_" + str(ind) + ".png"
)

to

fname = folder_path / (
                    path_obj.stem + "_" + str(ind).zfill(5) + ".png"
)

Thanks!

alisterburt commented 1 year ago

Hi there!

Really great suggestion, thanks for taking the time 🙂

Would you like to submit a pull request with the changes you proposed? I can help you through the process if it's new to you - this way you would become part of the contributors list

Also fine if you would rather I integrate the changes!

sassanostvar commented 1 year ago

Great, thank you! I just tried to submit a draft PR. I hope it worked? Really appreciate your time and all the great work!

alisterburt commented 1 year ago

Great work @sassanostvar ! I just merged #140 and pushed a new tag so the changes should be available in v0.0.4 on PyPI soon

https://github.com/napari/napari-animation/actions/runs/3451585929