From 45ba37e420c941a6956f1ad0e8bd53e3f15e36cc Mon Sep 17 00:00:00 2001 From: mbe Date: Sat, 19 Jul 2014 09:04:59 +0200 Subject: [PATCH] Added readme. --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..fe9b0cf --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# Thumbnail Generator for Synology PhotoStation +Creating thumbnails on the consumer level DiskStation NAS boxes by Synology is incredibly slow which makes indexing of large photo collections take forever to complete. It's much, much faster (days -> hours) to generate the thumbnails on your desktop computer over e.g. SMB using this small Python script. + +## Usage +`python dsthumbgen.py --directory ` + +Example: `python dsthumbgen.py --directory c:\photos` + +Subdirectories will always be processed. + +## Good to know +Given a file and folder structure like below: + +c:\photos\001.jpg +c:\photos\dir1\002.jpg + +...the utility will create the following: + +c:\photos\eaDir_tmp\001.jpg\SYNOPHOTO_THUMB_XL.jpg +c:\photos\eaDir_tmp\001.jpg\SYNOPHOTO_THUMB_B.jpg +c:\photos\eaDir_tmp\001.jpg\SYNOPHOTO_THUMB_M.jpg +c:\photos\eaDir_tmp\001.jpg\SYNOPHOTO_THUMB_PREVIEW.jpg +c:\photos\eaDir_tmp\001.jpg\SYNOPHOTO_THUMB_S.jpg +c:\photos\dir1\eaDir_tmp\002.jpg\SYNOPHOTO_THUMB_XL.jpg +c:\photos\dir1\eaDir_tmp\002.jpg\SYNOPHOTO_THUMB_B.jpg +c:\photos\dir1\eaDir_tmp\002.jpg\SYNOPHOTO_THUMB_M.jpg +c:\photos\dir1\eaDir_tmp\002.jpg\SYNOPHOTO_THUMB_PREVIEW.jpg +c:\photos\dir1\eaDir_tmp\002.jpg\SYNOPHOTO_THUMB_S.jpg + +`eaDir_tmp` is used as a temporary directory name as @ characters are not valid in file names on Windows. Therefore these folders must be renamed to `@eaDir` for PhotoStation to recognize them. This renaming process must be done via SSH to the DiskStation unless the volume is mounted by NFS. Useful commands: + +# remove any existing thumbnail directories, dry-run check print out before running next command! +find /volume1/photos -type d -name '@eaDir' -exec echo '{}' \; + +# remove any existing thumbnail directories +find /volume1/photos -type d -name '@eaDir' -exec rm -rf '{}' \; + +# rename directories +find /volume1/photos -type d -name 'eaDir_tmp' -exec mv '{}' @eaDir \;