![]() This can be accomplished simply on OS X using Launch Agents. For other operating systems there are of course ways to schedule tasks or submit cron jobs, but I will leave that as an exercise for the reader.Īn an optional setup, I like to automate the process of moving my photos. Note while sortphotos.py was written in a cross-platform way, the following instructions for automation are specific to OS X. The argument to the flag should be an integer between 0-23 corresponding to the hours of the day starting at midnight. By default the new day begins at midnight, but if you wanted any photos taken before 4AM to be grouped with the previous day you can use If you are taking photos for an event that goes past midnight, you might want the early morning photos to be grouped with those from the previous day. Python sortphotos.py -keep-duplicates /source /destination Invoke the option -keep-duplicates in order to skip duplicate detection. This option would be useful, for example, if you are copying over a bunch of new photos that you are sure don't already exist in your organized collection of photos. However you have the option of turning this off (not the name comparison, that will always happen, just the weeding out of duplicates). This will prevent you from having duplicate files. If they are exactly the same, it will just skip the copy (or move) operation. SortPhotos will go one step further and if it finds a file of the same name, it will then run a file compare to see if the files are actually the same. So for example if photo.jpg was taken on Jbut 2010 > June > photo.jpg already exists then the new file will be moved as photo_1.jpg and so on. It this occurs it will append a number on the end of the file. SortPhotos will always check to make sure something with the same file name doesn't already exist where it's trying to write, so that you don't unintentionally overwrite a file. Python sortphotos.py source destination -use-only-tags EXIF:CreateDate EXIF:DateTimeOriginal So for example, the default sorting behavior (2010/06-Jun) is equivalent to: To separate by subdirectory, just use a forward slash (even if you are on Windows). The script takes an optional argument -s or -sort, which accepts a format string using the conventions described here. However, you can customize the sorting style almost anyway you want. So for example if cool_picture.jpg was taken on Jthe resulting directory hierarchy will look like: 2010 > 06-Jun > cool_picture.jpg. sort in directoriesīy default folders are sorted by year then month, with both the month number and name. No files will be moved or copied, but all the moves will be simulated showing you how the files would be reorganized/renamed. If you just want to simulate what is going to happen with your command use the -t or -test flag. If you don't want to see details on file processing use the -s or -silent flag. If you want to search recursively, use the -r or -recursive flag. This is useful if you dump photos into your top directory and then want them to sort. Python sortphotos.py -c /source /destinationīy default, only the top level of the source directory is searched for files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |