1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# 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 <ingar@telenet.be>
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 <sam@hocevar.net>
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.
|