dotfiles/local/bin: update pre-process-media.sh

This commit is contained in:
Alan Orth 2024-04-28 13:11:48 +03:00
parent 4c2b8eb267
commit d21cb6a169
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# pre-process-media.sh v2022-08-01 # pre-process-media.sh v2024-04-28
# #
# Prepare a directory of images and videos for long-term archival by normalizing # Prepare a directory of images and videos for long-term archival by normalizing
# their names, optimizing JPEGs with jpeg-archive, and stripping embedded MP4s # their names, optimizing JPEGs with jpeg-archive, and stripping embedded MP4s
@ -10,6 +10,7 @@
# Changes: # Changes:
# #
# v2024-04-28: support Pixel portrait images
# v2022-08-01: fix minor syntax issue # v2022-08-01: fix minor syntax issue
# v2022-01-15: support Pixel panorama images # v2022-01-15: support Pixel panorama images
# v2021-12-26: add 'ftypiso6' for Nokia Android 9 MVIMG files, anchor regexes to # v2021-12-26: add 'ftypiso6' for Nokia Android 9 MVIMG files, anchor regexes to
@ -90,6 +91,9 @@ perl-rename 's/^PXL_([0-9]{4})([0-9]{2})([0-9]{2})_([0-9]+)\.NIGHT\.jpg/$1-$2-$3
# Rename PXL_20211118_162823829.PORTRAIT.jpg to 2021-11-18_162823829.jpg (Pixel Portrait mode) # Rename PXL_20211118_162823829.PORTRAIT.jpg to 2021-11-18_162823829.jpg (Pixel Portrait mode)
perl-rename 's/^PXL_([0-9]{4})([0-9]{2})([0-9]{2})_([0-9]+)\.PORTRAIT\.jpg/$1-$2-$3_$4.jpg/' *.jpg perl-rename 's/^PXL_([0-9]{4})([0-9]{2})([0-9]{2})_([0-9]+)\.PORTRAIT\.jpg/$1-$2-$3_$4.jpg/' *.jpg
# Rename PXL_20230413_231026946.PORTRAIT.ORIGINAL.jpg to 2023-04-13_231026946.jpg (Pixel portrait original?)
perl-rename 's/^PXL_([0-9]{4})([0-9]{2})([0-9]{2})_([0-9]+)\.PORTRAIT\.ORIGINAL\.jpg/$1-$2-$3_$4.jpg/' *.jpg
# Rename PXL_20210925_150154460.PANO.jpg to 2021-09-25_150154460.jpg (Pixel Panorama mode) # Rename PXL_20210925_150154460.PANO.jpg to 2021-09-25_150154460.jpg (Pixel Panorama mode)
perl-rename 's/^PXL_([0-9]{4})([0-9]{2})([0-9]{2})_([0-9]+)\.PANO\.jpg/$1-$2-$3_$4.jpg/' *.jpg perl-rename 's/^PXL_([0-9]{4})([0-9]{2})([0-9]{2})_([0-9]+)\.PANO\.jpg/$1-$2-$3_$4.jpg/' *.jpg