Files
synology-thumbgen/README.md

46 lines
1.8 KiB
Markdown
Raw Normal View History

2014-07-19 09:04:59 +02:00
# 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 <path>`
Example: `python dsthumbgen.py --directory c:\photos`
Subdirectories will always be processed.
## Good to know
Given a file and folder structure like below:
2014-07-19 09:07:59 +02:00
```
2014-07-19 09:04:59 +02:00
c:\photos\001.jpg
c:\photos\dir1\002.jpg
2014-07-19 09:07:59 +02:00
```
2014-07-19 09:04:59 +02:00
...the utility will create the following:
2014-07-19 09:07:59 +02:00
```
2014-07-19 09:04:59 +02:00
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
2014-07-19 09:07:59 +02:00
```
2014-07-19 09:04:59 +02:00
`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:
2014-07-19 09:07:59 +02:00
```
2014-07-19 09:04:59 +02:00
# 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 \;
2014-07-19 09:07:59 +02:00
```