A Digital Life

My Notebook

View My GitHub Profile

  • About
  • 7 June 2017

    Pipeline to Organize Pictures

    by kerner1000

    Collect

    Move pictures from all over the place into one working directory. Be careful not to override pictures with the same name! E.g., use mv --backup=numbered some_dir/* working_directory and mv --backup=numbered creates hidden backup files that might be ignored by follow-up programs. ‘unhide’ those files, e.g. using Dr.Rename’s build-in ‘unhide-rename-strategy’.

    (Fix Permisssions)

    sudo chown alex:users -R .

    (Delete File System Metadata)

    find . -type d -name '.@__thumb' -exec rm -r "{}" \;

    find . -name DS_Store -exec rm -r "{}" \;

    Convert .heic files

    Check files for duplicates

    Rename pictures by meta date

    Sort By Date

    Start to sort by date. Move to folders named by date, e.g. 2015-05. Again be careful to not override when moving.

    Also note, that too many files in one folder will kill performance of your graphical file manager such as Nautilus of Finder. I recommend to keep number of files per folder below 2k.

    You can check the number of files inside a folder with

    ls 2016 | wc -l

    (assuming your file names do not have white spaces)

    Example Linux

    mv --backup=numbered 201505*jpg ../2015-05/
    

    Example Mac

    rsync -a --backup --remove-source-files --progress 2012-*/*.jpg 2012
    

    Example

    mv 2021-0?/* 2021
    

    More Helpful sniplets

    Unzip all zips into current directory:

    unzip -B \*.zip
    

    Delete empty folders:

    find . -empty -type d -delete
    

    ..work in progress..

    tags: files and folders - pictures