# DCIMTOOLS A collection of shell scripts to manage the JPEG images produced by digital cameras, phones and other devices. ## Scripts ### dcimrename ```dcimrename file1.jpg file2.jpg ...``` Will read the EXIF timestamp from the jpg files on the command line and alter the file's modification time accordingly. Renames to file using the format IMG_yyyyddmm_hhmmss.jpg. Note that the file extension has to be ```.jpg``` in lower case, other extensions are ignored. You can preprocess your files with the linux ```rename``` utility. For example, if your files have their extension in upper case: ```rename .JPG .jpg *.JPG``` Also note the file name format has a resolution of one second. If your pictures' timestamp differ by less then a second, files will be overwritten. In general, the script does not check if files already exist and mercilessly overwrites them. ### dcimdirsort ```dcimdirsort``` Moves files into a subdirectory for each day, based on the file's modification time. For each file on the command line, it's file modification time will be read. If it doesn't exist already, a subdirectory with the format ```yyyy-mm-dd``` will be created and the file will be moved into it. ### dcimtimestamp ```dcimtimestamp file1.jpg file2.jpg ...``` Writes the files modification time to the EXIF timestamp. Can be used to correct broken or missing picture timestamps. The same .jpg file extension rule applies. ## Workflow #### Prepare Copy all the picture files you want to manage in a single directory. Make sure they have a valid and correct EXIF timestamp. Make sure you do not have any pictures taken less then a second apart. #### Rename Make sure all the pictures have the .jpg extension. If they don't, rename them accordingly. Run ```dcimrename *.jpg``` #### Move to subdirectories Run ```dcimdirsort *.jpg``` ## Notes Obviously, there is room for improvement. Ideally I'd write a C program and roll all functionallity into one program. Add additional checks and customization options etc... ## License dcimtools copyright (c) Stijn "Ingar" Buys, 2022 dcimtools is available under the terms and conditions of the Do What The Fuck You Want To Public License #### DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. #### DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE ##### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION * You just DO WHAT THE FUCK YOU WANT TO.